{
  "version": "https://jsonfeed.org/version/1", 
  "title": "webpack", 
  "description": "", 
  "home_page_url": "https://www.v2ex.com/go/webpack", 
  "feed_url": "https://www.v2ex.com/feed/webpack.json", 
  "icon": "https://cdn.v2ex.com/navatar/9908/279e/988_large.png?m=1496642083", 
  "favicon": "https://cdn.v2ex.com/navatar/9908/279e/988_normal.png?m=1496642083", 
  "items": [
    {
      "author": {
        "url": "https://www.v2ex.com/member/justdoit123", 
        "name": "justdoit123", 
        "avatar": "https://cdn.v2ex.com/gravatar/bc725ae9e1d45eb0e54dadc774b5ab96?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/1054232", 
      "title": "[\u524d\u7aef] \u524d\u540e\u7aef\u5206\u79bb\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u5bf9 session \u6709\u4f9d\u8d56\uff0c\u5982\u4f55\u4f18\u96c5\u5904\u7406\uff1f", 
      "id": "https://www.v2ex.com/t/1054232", 
      "date_published": "2024-07-02T06:26:37+00:00", 
      "content_html": "<p>\u6709\u4e00\u4e2a\u9875\u9762\u53ca\u5176\u76f8\u5173 api \u9700\u8981\u52a0\u4e0a\u4e00\u4e9b\u4fdd\u62a4\uff0c\u8fd9\u4e9b\u4fdd\u62a4\u7684\u4e0a\u4e0b\u6587\u5b58\u50a8\u5728 server session \u4e2d\u7684\u3002</p>\n<p>\u524d\u7aef\u5f00\u53d1\u7684\u65f6\u5019\uff0cwebpack devServer \u8f6c\u53d1\u7684 api \u4f1a\u56e0\u4e3a\u8fc7\u4e0d\u4e86\u8fd9\u4e9b\u4fdd\u62a4\u68c0\u67e5\u800c\u88ab\u62e6\u4e0b\u3002\u4e0d\u77e5\u9053\u5404\u4f4d\u6709\u6ca1\u6709\u6bd4\u8f83\u4f18\u96c5\u7684\u65b9\u6848\uff1f</p>\n<p>\u6211\u4eec\u73b0\u5728\u662f\u624b\u52a8\u7684\u628a cookie \u590d\u5236\u5728 localhost \u57df\u540d\u4e0b\u3002</p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/realJamespond", 
        "name": "realJamespond", 
        "avatar": "https://cdn.v2ex.com/gravatar/5ad087845dfa481ca314d3edab4b163f?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/858169", 
      "title": "\u5982\u4f55\u5728\u7f16\u8bd1\u65f6\u68c0\u6d4b\u662f\u5426\u5f15\u5165\u5f00\u53d1\u7684\u4ee3\u7801", 
      "id": "https://www.v2ex.com/t/858169", 
      "date_published": "2022-06-08T06:00:50+00:00", 
      "content_html": "<p>\u6bd4\u5982<code>import './some-dev-code.ts'</code><br/>\n\u6709\u6ca1\u6709\u4e00\u79cd\u53ef\u80fd, \u5728\u7f16\u8bd1\u671f\u53ef\u4ee5\u68c0\u6d4b\u51fa\u5e76\u76f4\u63a5\u629b\u9519.<br/>\n\u76ee\u524d\u6211\u662f\u5728<code>some-dev-code.ts</code>,\u52a0\u5165\u5224\u65ad process.env.dev \u7136\u540e\u629b\u9519, \u4f46\u662f\u53ea\u80fd\u5728 runtime \u624d\u77e5\u9053...</p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/yazoox", 
        "name": "yazoox", 
        "avatar": "https://cdn.v2ex.com/avatar/7b39/2690/111562_large.png?m=1635297358"
      }, 
      "url": "https://www.v2ex.com/t/854937", 
      "title": "webpack-dev-server \u542f\u52a8 dev server \u540e\uff0c\u5982\u4f55\u8ba9\u5176\u5b83\u7684\u673a\u5668\u53ef\u4ee5\u8bbf\u95ee\u8be5 server?", 
      "id": "https://www.v2ex.com/t/854937", 
      "date_published": "2022-05-24T04:27:20+00:00", 
      "content_html": "<p>\u4e3b\u8981\u662f\u4e3a\u4e86\u8c03\u8bd5\u65b9\u4fbf\u3002</p>\n<p>\u672c\u5730 IP: 198.0.1.2\n\u9632\u706b\u5899\u5df2\u7ecf\u5173\u95ed</p>\n<p>\u7136\u540e\u7528 webpack-dev-server \u542f\u52a8\u540e\uff0c\u7aef\u53e3\u662f 8080. \u672c\u5730\u8bbf\u95ee\uff1a http://locahost:8080/\u53ef\u4ee5\u6210\u529f</p>\n<p>\u53e6\u5916\u4e00\u53f0\u673a\u5668 198.0.1.10 \u8bbf\u95ee <a href=\"http://198.0.1.2:8080\" rel=\"nofollow\">http://198.0.1.2:8080</a> \u63d0\u793a\u6211</p>\n<pre><code>This site can\u2019t be reached\n198.0.1.2 refused to connect.\n</code></pre>\n<p>\u6211\u6dfb\u52a0\u4e86\u542f\u52a8\u53c2\u6570\uff0c\u6bd4\u5982\uff1a--public 0.0.0.0:8080 \uff08\u6216\u8005 --public 198.0.1.2:8080 \uff09\u770b\u547d\u4ee4\u884c\uff0c\u63d0\u793a server \u542f\u52a8\u6210\u529f\uff0c\u4f46\u662f\u5728\u6d4f\u89c8\u5668\u91cc\u9762\u8f93\u5165 <a href=\"http://0.0.0.0:8080\" rel=\"nofollow\">http://0.0.0.0:8080</a> \u76f4\u63a5\u63d0\u793a\u6211\u9519\u8bef\uff08\u5c31\u66f4\u522b\u63d0\u8fdc\u7a0b\u8bbf\u95ee\u4e86\uff09</p>\n<pre><code>This site can\u2019t be reached\nThe webpage at http://0.0.0.0:8080/ might be temporarily down or it may have moved permanently to a new web address.\n</code></pre>\n<p>google \u4e86\u4e00\u4e0b\uff0c\u4ec0\u4e48 allowedHosts \uff0cdisableHostCheck \u53c2\u6570\u4e5f\u8bbe\u7f6e\u4e86\uff0c\u8c8c\u4f3c\u6ca1\u6709\u5565\u7528\u3002<br/>\np.s. refer to:<br/>\n<a href=\"https://github.com/webpack/webpack-dev-server/issues/882\" rel=\"nofollow\">https://github.com/webpack/webpack-dev-server/issues/882</a></p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/yazoox", 
        "name": "yazoox", 
        "avatar": "https://cdn.v2ex.com/avatar/7b39/2690/111562_large.png?m=1635297358"
      }, 
      "url": "https://www.v2ex.com/t/842684", 
      "title": "webpack.config.js \u5728 exports \u914d\u7f6e\u4e4b\u524d\uff0c\u80fd\u5148\u6267\u884c\u4e00\u6bb5\u5f02\u6b65\u4ee3\u7801\u5230\uff1f", 
      "id": "https://www.v2ex.com/t/842684", 
      "date_published": "2022-03-24T10:34:18+00:00", 
      "content_html": "<p>\u6211\u60f3\u5148\u6267\u884c\u4e00\u6bb5\u5f02\u6b65\u4ee3\u7801\uff0c\u5982\u4e0b\uff0c\u628a commitHash \u5199\u5165\u5230 process.env \u91cc\u9762\u53bb\uff0c\u7136\u540e\u518d\u8fd4\u56de webpack \u7684\u914d\u7f6e\uff1a</p>\n<pre><code>async function getLastCommitHash() {\n  return new Promise(resolve =&gt; {\n      require('child_process').exec('git rev-parse HEAD', function(err, stdout) {\n        resolve(stdout);\n      });\n  }\n}\n\nconst run = async () =&gt; {\nconst commit = await getLastCommitHash();\nreturn\n    {\n      ...\n      plugins:       new webpack.DefinePlugin({\n            \"process.env\": commit\n          })\n\n    }\n}\n\n</code></pre>\n<p>\u6211\u53c2\u8003\u4e86\u4e00\u4e0b\u8fd9\u91cc\u7684\u505a\u6cd5\uff1a\n<a href=\"https://stackoverflow.com/questions/53991856/how-do-i-await-a-piece-of-code-within-weback-config\" rel=\"nofollow\">https://stackoverflow.com/questions/53991856/how-do-i-await-a-piece-of-code-within-weback-config</a></p>\n<p>module.exports = run(); \u6216\u8005 <br/>\nmodule.exports = run;\n\u8c8c\u4f3c\u90fd\u4e0d\u884c\u3002</p>\n<p>\u8fd9\uff0c\u6709\u6ca1\u6709\u529e\u6cd5\uff0c\u5728 webpack.config.js \u91cc\u9762\uff0c\u5148\u6267\u884c\u4e00\u6bb5\u5f02\u6b65\u4ee3\u7801\u518d\u8fd4\u56de\u914d\u7f6e\u5462\uff1f</p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/zy0829", 
        "name": "zy0829", 
        "avatar": "https://cdn.v2ex.com/gravatar/79dd8e37b9402a68590f9a6db48b8a11?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/834542", 
      "title": "webpack \u5173\u4e8e\u4f9d\u8d56\u63d0\u53d6\u7684 build \u5dee\u5f02", 
      "id": "https://www.v2ex.com/t/834542", 
      "date_published": "2022-02-17T08:10:14+00:00", 
      "content_html": "<p>\u6587\u4ef6 A.js \u5f15\u5165\u4e86\u4f9d\u8d56 dep.js \uff0c\u7136\u540e\u53c8\u52a8\u6001\u52a0\u8f7d\u4e86 import('bjs, cjs') ,  \u8fd9\u4e24\u4e2a\u6587\u4ef6 bjs cjs \u4e5f\u90fd\u5f15\u5165\u4e86 dep.js</p>\n<p>\u5f53\u6211\u914d\u7f6e\u4e86 splitChunks, chunks: all, minChunks:2 \u7684\u60c5\u51b5\u4e0b dep.js \u5e76\u6ca1\u6709\u88ab\u5355\u72ec\u63d0\u53d6\u51fa\u6765 </p>\n<p>\u5982\u679c A.js \u6ca1\u6709\u5f15\u5165\u4f9d\u8d56 dep.js \u7f16\u8bd1\u540e dep.js \u5c31\u80fd\u88ab\u5355\u72ec\u63d0\u53d6\u51fa\u6765\uff0c\u8fd9\u662f\u4e3a\u5565</p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/yazoox", 
        "name": "yazoox", 
        "avatar": "https://cdn.v2ex.com/avatar/7b39/2690/111562_large.png?m=1635297358"
      }, 
      "url": "https://www.v2ex.com/t/830419", 
      "title": "webpack \u91cc\u9762 definePlugin \u91cc\u9762\u5b9a\u4e49\u4e86\u4e00\u4e9b process.env \u7684\u53d8\u91cf\uff0c\u8fd9\u4e2a\u662f\u5982\u4f55\u5e94\u7528\u5230 runtime \u73af\u5883\u7684\uff1f", 
      "id": "https://www.v2ex.com/t/830419", 
      "date_published": "2022-01-25T02:35:35+00:00", 
      "content_html": "<p>\u6211\u7684\u7406\u89e3\uff0cwebpack \u662f\u4e2a\u6253\u5305\u5de5\u5177\uff0c\u662f\u5728 compile \u9636\u6bb5\u3002\n\u6253\u5305\u597d\u4ee5\u540e\uff0c\u628a bundle \u90e8\u7f72\u5230\u670d\u52a1\u5668\u4e0a\uff0c\u6bd4\u5982 aws \u4e0a\u9762\uff0c\u8fd0\u884c\u540e\uff0c\u662f\u600e\u4e48\u5e94\u7528\u8fd9\u4e9b process.env \u7684\uff1f</p>\n<p>\u662f webpack \u6253\u5305\u65f6\uff0c\u628a process.env \u751f\u6210\u4e86\u4e00\u4e2a\u6587\u4ef6\uff0c\u7136\u540e\u5728 runtime \u518d\u628a\u8fd9\u4e9b variables \u4ece\u6587\u4ef6\u91cc\u9762\u8bfb\u53d6\u51fa\u6765\u4e86\u4e48\uff1f</p>\n<p>\u6211 google \u4e86\u4e00\u4e0b\uff0c\u627e\u76f8\u5173\u6587\u6863\uff0c\u6ca1\u6709\u627e\u5230\u3002</p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/yazoox", 
        "name": "yazoox", 
        "avatar": "https://cdn.v2ex.com/avatar/7b39/2690/111562_large.png?m=1635297358"
      }, 
      "url": "https://www.v2ex.com/t/811530", 
      "title": "webpack \u73b0\u5728\u4f9d\u7136\u4e0d\u80fd\u81ea\u52a8\u652f\u6301 tree-shaking\uff0c\u6765\u4f18\u5316\u5f15\u5165\u7684\u5305\u4e48\uff1f", 
      "id": "https://www.v2ex.com/t/811530", 
      "date_published": "2021-10-29T06:42:16+00:00", 
      "content_html": "<p><a href=\"https://www.jianshu.com/p/7994b1fc6dfe\" rel=\"nofollow\">https://www.jianshu.com/p/7994b1fc6dfe</a></p>\n<p>\u8bfb\u5230\u4e00\u7bc7\u6587\u7ae0\uff0c\u63d0\u5230\u4e86\uff0cwebpack \u5982\u679c\u60f3\u5728\u5f15\u5165\u4e00\u4e2a\u5305\u7684\u65f6\u5019\uff0c\u7f16\u8bd1\u53ea\u5f15\u5165\u7684\u90a3\u90e8\u5206\u4ee3\u7801\uff0c\u9700\u8981 babel \u7684\u652f\u6301\u3002\u800c\u4e14\uff0c\u53ea\u5bf9\u81ea\u5df1\u7684\u4ee3\u7801\u6709\u6548\u3002\u5982\u679c\u662f\u7b2c\u4e09\u65b9\u7684\u5305\uff0c\u8fd8\u4e0d\u884c\uff0c\u5f97\u5199\u4e00\u4e2a\u63d2\u4ef6\uff0c\u5b9e\u73b0\u8f6c\u6362\u3002\u6bd4\u5982\uff0c</p>\n<pre><code>import { x } from 'module1';\n\n\u8f6c\u6362\u6210\n\nimport { x } from 'module1/a/bc';\n\n</code></pre>\n<p>\u8981\u8fd9\u4e48\u9ebb\u70e6\u624d\u80fd\u591f\u5b9e\u73b0 tree-shaking \u554a\uff01</p>\n<p>\u5f53\u7136\u8fd9\u662f 3 \u5e74\u524d\u7684\u6587\u7ae0\u4e86\uff0c\u73b0\u5728\u7684 webpack \u4e5f\u8fdb\u5316\u5230\u4e86 5.0 \u7684\u7248\u672c\u4e86\u5427\uff1f\u73b0\u5728\u8fd8\u662f\u8fd9\u6837\u7684\u4e48\uff1f</p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/SystemLight", 
        "name": "SystemLight", 
        "avatar": "https://cdn.v2ex.com/avatar/daf0/50fc/439445_large.png?m=1567520788"
      }, 
      "url": "https://www.v2ex.com/t/746431", 
      "title": "webpack5 \u6253\u5305\u540e\u4e3a\u4f55\u6700\u5916\u5c42\u4f7f\u7528\u7684\u662f\u7bad\u5934\u51fd\u6570\u5305\u88f9\uff0c\u80fd\u5426\u53bb\u6389\uff1f", 
      "id": "https://www.v2ex.com/t/746431", 
      "date_published": "2021-01-19T12:12:23+00:00", 
      "content_html": "<p>webpack5 \u6253\u5305\u540e\u5982\u4e0b\uff0c\u5e76\u975e babel \u914d\u7f6e\u95ee\u9898\uff0c\u5305\u88f9\u5185\u7684\u4ee3\u7801\u6ca1\u6709\u95ee\u9898\u3002</p>\n<pre><code>(()=&gt;{\"use strict\";console.log(\"hello\")})();\n</code></pre>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/SystemLight", 
        "name": "SystemLight", 
        "avatar": "https://cdn.v2ex.com/avatar/daf0/50fc/439445_large.png?m=1567520788"
      }, 
      "url": "https://www.v2ex.com/t/740236", 
      "title": "\u4e3a\u4ec0\u4e48\u8d77\u4e2a\u7a7a\u9879\u76ee\u914d\u7f6e webpack \u7f16\u8bd1\u7684\u901f\u5ea6\u4e0d\u5982 create-react-app \u521b\u5efa\u7684\u9879\u76ee\u5feb\uff1f", 
      "id": "https://www.v2ex.com/t/740236", 
      "date_published": "2020-12-30T02:51:28+00:00", 
      "content_html": "<ol>\n<li>create-react-app \u5bf9\u7f16\u8bd1\u505a\u4e86\u4ec0\u4e48\u4f18\u5316\u4e48\uff1f</li>\n<li>ts-loader \u5f88\u62d6\u7f16\u8bd1\u65f6\u5e38\uff0c\u5e94\u8be5\u5982\u4f55\u89e3\u51b3</li>\n</ol>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/wszgrcy", 
        "name": "wszgrcy", 
        "avatar": "https://cdn.v2ex.com/gravatar/580faa0c768668e7325c10e06f49aefc?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/713884", 
      "title": "\u95ee\u4e0b\u5927\u4f6c\u4eec,webpack \u7684\u52a8\u6001\u5bfc\u5165\u600e\u4e48\u5b9e\u73b0\u6bd4\u8f83\u597d?", 
      "id": "https://www.v2ex.com/t/713884", 
      "date_published": "2020-10-11T03:29:05+00:00", 
      "content_html": "<h1>\u4e0d\u662f import \u6216\u8005\u8bf4\u4e0d\u662f\u4f60\u4eec\u60f3\u7684 import</h1>\n<ul>\n<li>webpack \u4e2d\u7684\u52a8\u6001\u5f15\u5165,\u6307\u7684\u662f\u901a\u8fc7\u903b\u8f91\u5224\u65ad,\u5224\u65ad\u6a21\u5757\u662f\u5426\u52a0\u8f7d,\u6bd4\u5982<code>import('xxx')</code>,\u4f46\u662f\u8fd9\u6837 xxx \u88ab\u9650\u5b9a\u4f4f\u4e86,\u6240\u8c13\u52a8\u6001,\u5176\u5b9e\u4e5f\u662f\u6709\u6307\u5b9a\u8303\u56f4\u7684\u52a8\u6001</li>\n</ul>\n<h1>\u5982\u4f55\u5b9e\u73b0\u771f\u6b63\u7684\u52a8\u6001?</h1>\n<ul>\n<li>\u6bd4\u5982 import(\u53d8\u91cf),\u8fd9\u4e2a\u53d8\u91cf\u662f\u4ece\u540e\u7aef,\u6216\u8005\u624b\u52a8\u8f93\u5165,\u5b8c\u5168\u65e0\u89c4\u5219(\u4f46\u662f\u6709\u8fd9\u4e2a\u6a21\u5757,\u53ea\u4e0d\u8fc7\u4e0d\u662f\u5728\u6784\u5efa\u65f6\u51fa\u73b0\u7684,\u800c\u662f\u540e\u671f\u7684\u8865\u5145),</li>\n</ul>\n<h1>\u662f\u5426\u9700\u8981\u5176\u4ed6\u7684\u914d\u7f6e\u914d\u5408</h1>\n<ul>\n<li>\u8fd9\u4e48\u5f15\u5165,\u9996\u5148\u8981\u4fdd\u8bc1\u88ab\u5f15\u5165\u7684\u6a21\u5757\u662f\u7b26\u5408 webpack \u6253\u5305\u7684,</li>\n<li>\u7136\u540e\u5c31\u662f webpack \u8981\u5141\u8bb8\u8fd9\u79cd\u65b9\u5f0f(\u4f46\u662f\u73b0\u5728 import \u90fd\u4f1a\u505a\u68c0\u67e5,\u597d\u50cf\u6ca1\u6709\u8fd9\u79cd\u65b9\u5f0f)</li>\n</ul>\n<h1>\u4e0d\u77e5\u9053\u5927\u4f6c\u4eec\u6709\u6ca1\u6709\u8fd9\u79cd\u6280\u672f,\u5e2e\u5fd9\u63d0\u4e2a\u9192\u5c31\u884c\u4e86</h1>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/w3cfed", 
        "name": "w3cfed", 
        "avatar": "https://cdn.v2ex.com/avatar/6d85/b568/485827_large.png?m=1655710134"
      }, 
      "url": "https://www.v2ex.com/t/702367", 
      "title": "\u4f60\u771f\u7684\u7406\u89e3 Webpack\uff1f\u8bf7\u56de\u7b54\u4e0b\u5217\u95ee\u9898\u3002", 
      "id": "https://www.v2ex.com/t/702367", 
      "date_published": "2020-08-29T02:59:28+00:00", 
      "content_html": "<p><img alt=\"\u4f60\u771f\u7684\u7406\u89e3 Webpack?\" src=\"https://cdn.learnku.com/uploads/images/202008/29/11426/DJPHnrxB9u.png%21large\"/></p>\n<blockquote>\n<p>\u4f60\u771f\u7684\u7406\u89e3 Webpack \uff1f \u5982\u679c\u77e5\u9053\u4ee5\u4e0b\u95ee\u9898\u7684\u7b54\u6848\uff0c\u5219\u610f\u5473\u7740\u5df2\u7ecf\u638c\u63e1\u4e86 <code>Webpack</code>\u3002 \u6b22\u8fce\u63d0\u4f9b\u60a8\u7684\u7b54\u6848\u3002</p>\n</blockquote>\n<ul>\n<li>\n<p><a href=\"https://github.com/martinageradams/1024.Cool/issues/1\" rel=\"nofollow\">Chinese</a> <a href=\"https://www.1024.cool/webpack/understand-webpack-in-one-article.html\" rel=\"nofollow\">\u4e00\u6587\u641e\u5b9a Webpack \u9762\u8bd5</a></p>\n</li>\n<li>\n<p><a href=\"https://github.com/martinageradams/blog/issues/12\" rel=\"nofollow\">English</a></p>\n</li>\n</ul>\n<h2>Webpack \u5b9e\u6218</h2>\n<ul>\n<li>\u4e0e Webpack \u7c7b\u4f3c\u7684\u5de5\u5177\u8fd8\u6709\u54ea\u4e9b</li>\n<li>\u8c08\u8c08\u4f60\u4e3a\u4ec0\u4e48\u9009\u62e9\u4f7f\u7528\u6216\u653e\u5f03 webpack</li>\n<li><code>Loader</code> \u548c <code>Plugin</code> \u7684\u4e0d\u540c</li>\n<li>\u6709\u54ea\u4e9b\u5e38\u89c1\u7684 <code>Loader</code>\uff1f\u4ed6\u4eec\u80fd\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\uff1f</li>\n<li>\u6709\u54ea\u4e9b\u5e38\u89c1\u7684 <code>Plugin</code>\uff1f\u4ed6\u4eec\u80fd\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\uff1f</li>\n<li>\u5982\u4f55\u5229\u7528 <code>Webpack</code> \u6765\u4f18\u5316\u524d\u7aef\u6027\u80fd</li>\n<li>\u5982\u4f55\u63d0\u9ad8 <code>Webpack</code> \u7684\u6784\u5efa\u901f\u5ea6?</li>\n<li>\u5982\u4f55\u5bf9 <code>bundle</code> \u4f53\u79ef\u8fdb\u884c\u76d1\u63a7\u548c\u5206\u6790\uff1f</li>\n<li>\u600e\u4e48\u914d\u7f6e\u5355\u9875\u5e94\u7528\uff1f\u600e\u4e48\u914d\u7f6e\u591a\u9875\u5e94\u7528\uff1f</li>\n<li>\u5982\u4f55\u5728 <code>Vue</code> \u548c <code>React</code> \u9879\u76ee\u4e2d\u5b9e\u73b0\u6309\u9700\u52a0\u8f7d\uff1f</li>\n<li><code>monorepo</code> \u8fd9\u79cd\u9879\u76ee\u6709\u4ec0\u4e48\u597d\u5904\uff0c\u5177\u4f53\u662f\u5982\u4f55\u6253\u5305\u7684\uff1f</li>\n<li><code>Source Map</code> \u662f\u4ec0\u4e48\uff1f\u751f\u4ea7\u73af\u5883\u600e\u4e48\u7528\uff1f</li>\n<li>\u4ec0\u4e48\u662f\u957f\u7f13\u5b58\uff1f</li>\n<li>\u5728 <code>Webpack</code> \u4e2d\u5982\u4f55\u505a\u5230\u957f\u7f13\u5b58\u4f18\u5316\uff1f</li>\n<li><code>Webpack</code> \u4e2d <code>hash</code> <code>chunkhash</code> <code>contenthash</code> \u6709\u4ec0\u4e48\u533a\u522b\uff1f</li>\n</ul>\n<h2>Webpack \u539f\u7406</h2>\n<ul>\n<li><code>Webpack</code> \u7684\u6784\u5efa\u6d41\u7a0b\u662f\u4ec0\u4e48\uff1f</li>\n<li>\u662f\u5426\u5199\u8fc7 <code>Loader</code> ?\u63cf\u8ff0\u4e00\u4e0b\u7f16\u5199 <code>Loader</code> \u7684\u601d\u8def\uff1f</li>\n<li>\u662f\u5426\u5199\u8fc7 <code>Plugin</code> ?\u63cf\u8ff0\u4e00\u4e0b\u7f16\u5199 <code>Plugin</code> \u7684\u601d\u8def\uff1f</li>\n<li><code>inline</code> <code>pre</code> <code>post</code> <code>normal</code> <code>loader</code> \u6267\u884c\u5148\u540e\u987a\u5e8f\u662f\uff1f</li>\n<li><code>Webpack</code> \u6253\u5305\u7684\u539f\u7406\u662f\u4ec0\u4e48\uff1f\u804a\u4e00\u804a babel \u548c\u62bd\u8c61\u8bed\u6cd5\u6811</li>\n<li><code>dev-server</code> \u7684\u539f\u7406\u662f\u4ec0\u4e48\uff1f\u63cf\u8ff0\u4e00\u4e0b\u5b83\u7684\u5177\u4f53\u6d41\u7a0b</li>\n<li>\u8bf7\u8bf4\u4e00\u4e0b <code>DIlPlugin</code> \u548c <code>DllReferencePlugin</code> \u7684\u5de5\u4f5c\u539f\u7406</li>\n<li><code>Webpack</code> \u7684\u70ed\u66f4\u65b0\u662f\u5982\u4f55\u505a\u5230\u7684\uff1f\u8bf4\u660e\u5176\u539f\u7406\uff1f</li>\n<li><code>Tree shaking</code>\u4e86\u89e3\u8fc7\u4e48\uff1f\u5b83\u7684\u5b9e\u73b0\u539f\u7406\u8bf4\u4e00\u4e0b</li>\n</ul>\n<h2>Webpack 5</h2>\n<ul>\n<li><code>Webpack 5</code> \u4e2d\u6709\u54ea\u4e9b\u65b0\u7279\u6027</li>\n<li><code>Webpack 5</code> \u4e2d\u7684 <code>Module Federation</code> \u5bf9\u5fae\u524d\u7aef\u7684\u610f\u4e49</li>\n</ul>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/maryshaw", 
        "name": "maryshaw", 
        "avatar": "https://cdn.v2ex.com/gravatar/a2a854e3d6290485dc95aad539b56138?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/695090", 
      "title": "webpack \u90a3\u4e48\u725b\u903c\u3002\u5982\u679c\u53ea\u662f\u5199 vue \u7684\u8bdd\uff0c\u53ea\u662f\u4e0d\u662f\u53ea\u8981 vue cli \u5c31\u591f\u4e86\u3002", 
      "id": "https://www.v2ex.com/t/695090", 
      "date_published": "2020-08-02T13:34:31+00:00", 
      "content_html": "<p>\u6682\u65f6\u89c9\u5f97\u6ca1\u6709\u7528\u5230 webpack \u7684\u673a\u4f1a\u2026\u2026\u4f60\u4eec\u5728\u4ec0\u4e48\u65f6\u5019\u7528\u5230 webpack \u3002</p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/duanzs", 
        "name": "duanzs", 
        "avatar": "https://cdn.v2ex.com/avatar/bd1a/d699/326849_large.png?m=1608540841"
      }, 
      "url": "https://www.v2ex.com/t/678715", 
      "title": "\u4e3a\u4ec0\u4e48 vue \u9879\u76ee\u6728\u6253\u5305\u540e\u5fc5\u987b\u90e8\u7f72\u5728\u670d\u52a1\u5668\u6216\u672c\u5730\u8d77\u4e00\u4e2a web \u670d\u52a1\u624d\u80fd\u8fd0\u884c\uff1f", 
      "id": "https://www.v2ex.com/t/678715", 
      "date_published": "2020-06-04T12:34:29+00:00", 
      "content_html": "<p>\u6211\u81ea\u5df1\u7f16\u5199 html \u6587\u4ef6\uff0c\u53ef\u4ee5\u76f4\u63a5\u7528\u6d4f\u89c8\u5668\u6253\u5f00\uff0c\u4f46\u662f\u7528 vue \u9879\u76ee\u6253\u5305\u540e\u76f4\u63a5\u7528\u6d4f\u89c8\u5668\u6253\u5f00 index.html \u5c31\u6253\u4e0d\u5f00\uff08\u767d\u6846\uff09</p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/Shook", 
        "name": "Shook", 
        "avatar": "https://cdn.v2ex.com/avatar/9d75/9d16/360944_large.png?m=1544542609"
      }, 
      "url": "https://www.v2ex.com/t/668970", 
      "date_modified": "2020-05-06T08:12:30+00:00", 
      "content_html": "<p>\u6bd4\u5982\u6211\u6709\u4e00\u4e2a main.js\uff1a</p>\n<pre><code class=\"language-javascript\">define([\n\tconfig, // ./config.js\n\tJApp, // ./modules/module-common/app.js\n], function(config, JApp) {\n\t...\n});\n</code></pre>\n<p>\u540c\u65f6\uff0c\u6211\u8fd8\u6709\u4e2a config \u6587\u4ef6\uff1a</p>\n<pre><code class=\"language-javascript\">define([], function() {\n\treturn {\n\t\tconfig: 'config',\n\t\tJApp: './modules/module-common/app',\n\t\tHApp: './modules/module-common/app.html',\n\t};\n});\n</code></pre>\n<p>\u6211\u5728\u5c1d\u8bd5\u4f7f\u7528 webpack \u6253\u5305 main.js \u65f6\uff0cwebpack \u4f1a\u63d0\u793a\u627e\u4e0d\u5230\u6a21\u5757\u2018JApp\u2019\uff0c\u56e0\u4e3a\u786e\u5b9e\u4e0d\u5b58\u5728\u561b\u3002\n\u4e8e\u662f\u6211\u5c31\u914d\u7f6e\u4e86\u4e00\u4e0b webpack.resolve.alias\uff0c\u5c31\u662f\u76f4\u63a5\u5c06 config \u6587\u4ef6\u7684\u5185\u5bb9\u8d4b\u7ed9 webpack.resolve.alias \u3002\n\u4f46\u7ed3\u679c\u662f\u4ecd\u65e7\u62a5\u9519\uff1a</p>\n<blockquote>\n<p>Module not found: Error: Can't resolve 'JApp' in 'D:\\codes\\webpack\\webpack-test\\webapp\\static'\n@ ../webapp/static/main.js 13:4-227:6</p>\n</blockquote>\n<p>\u6211\u8be5\u600e\u4e48\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u5462\uff1f</p>\n", 
      "date_published": "2020-05-06T08:12:14+00:00", 
      "title": "Webpack \u4e2d\u5982\u4f55\u5173\u8054 AMD \u6a21\u5757\u7684\u4f9d\u8d56\u6620\u5c04\uff1f", 
      "id": "https://www.v2ex.com/t/668970"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/duanzs", 
        "name": "duanzs", 
        "avatar": "https://cdn.v2ex.com/avatar/bd1a/d699/326849_large.png?m=1608540841"
      }, 
      "url": "https://www.v2ex.com/t/620733", 
      "title": "vue \u7f16\u8bd1\u540e\u5982\u4f55\u5d4c\u5165\u5230\u7c7b\u4f3c jsp \u8001\u7cfb\u7edf\u4e2d\uff1f", 
      "id": "https://www.v2ex.com/t/620733", 
      "date_published": "2019-11-18T09:11:38+00:00", 
      "content_html": "<p>\u80cc\u666f\uff1a\u4e00\u4e2a\u8001\u9879\u76ee\uff0c\u524d\u540e\u7aef\u672a\u5206\u79bb\uff0c\u524d\u7aef\u7528\u7684\u7c7b\u4f3c jsp \u8fd9\u79cd\u6280\u672f\uff0c\u548c\u540e\u7aef\u662f\u4e00\u671f\u6253\u5305\u53d1\u5e03\u3002\u73b0\u5728\u8981\u505a\u4e00\u4e2a\u5927\u9700\u6c42\u6a21\u5757\uff0c\u548c\u539f\u6765\u7cfb\u7edf\u6709\u5173\u8054\uff0c\u4f46\u4e0d\u662f\u5f88\u5927\uff0c\u60f3\u4f7f\u7528 vue\uff0cjsp \u8fd9\u79cd\u6280\u672f\u5df2\u7ecf\u4e0d\u8003\u8651\u7684\uff0c\u5f00\u53d1\u592a\u6162\u4e86\u3002</p>\n<p>\u624b\u6bb5\uff1a\u65b0\u6a21\u5757\u5355\u72ec\u8d77\u4e2a\u5de5\u7a0b\uff0c\u91c7\u7528 vue \u5f00\u53d1\u3002\u5728\u8001\u7cfb\u7edf\u65b0\u589e\u4e00\u4e2a\u83dc\u5355 /\u76ee\u5f55\uff0c\u65b0\u6a21\u5757\u7f16\u8bd1\u597d\u5c06\u6587\u4ef6\u653e\u7f6e\u8001\u7cfb\u7edf\u5bf9\u5e94\u76ee\u5f55\uff0c\u7136\u540e\u8001\u7cfb\u7edf\u5411\u4ee5\u524d\u4e00\u6837\u968f\u540e\u7aef\u4e00\u671f\u6253\u5305\u90e8\u7f72\u3002</p>\n<p>\u95ee\u9898\uff1a\u5982\u4f55\u6253\u5305 vue \u5de5\u7a0b\uff0c\u7f16\u8bd1\u597d\u53c8\u5982\u4f55\u5d4c\u5165\u8001\u7cfb\u7edf?</p>\n<p>\u5426\u5b9a\u65b9\u6848\uff1a\u65b0\u7cfb\u7edf\u5355\u72ec\u90e8\u7f72\u4e00\u5957\u73af\u5883\uff0c\u7136\u540e\u7528 frame \u5f04\u4e2a\u7a97\u53e3\u3002\u8fd9\u79cd\u65b9\u6848\u88ab\u5426\u5b9a\u4e86\uff0c\u56e0\u4e3a\u9700\u8981\u65b0\u90e8\u7f72\u73af\u5883\uff01</p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/mashirozx", 
        "name": "mashirozx", 
        "avatar": "https://cdn.v2ex.com/avatar/e81d/4d72/233876_large.png?m=1648484276"
      }, 
      "url": "https://www.v2ex.com/t/616204", 
      "date_modified": "2019-11-04T11:32:15+00:00", 
      "content_html": "<p><code>webpack-dev-serer</code> \u8c03\u8bd5\u7684\u65f6\u5019\uff0c<code>bundle.css</code> \u91cc\u9762\u67d0\u4e2a\u8d44\u6e90\u8def\u5f84\u662f <code>url(../dist/images/wave.svg)</code>\uff0c\u4f46\u662f\u7b49\u6211 <code>npm run build</code> \u6784\u5efa\u51fa\u6765\u7684 <code>bundle.css</code> \u91cc\u9762\u8d44\u6e90\u8def\u5f84\u5374\u53d8\u6210\u4e86 <code>url(../../dist/images/wave.svg)</code>\uff0c\u767e\u601d\u4e0d\u5f97\u5176\u89e3\u554a\u3002\u3002\u3002</p>\n<p>\u9879\u76ee\u53ca <a href=\"https://github.com/mashirozx/sakura2/blob/master/webpack.config.js\" rel=\"nofollow\">webpack.config.js \u5728\u8fd9\u91cc\uff08 Github \uff09</a>\u3002</p>\n<p><img alt=\"image\" src=\"https://user-images.githubusercontent.com/16148054/68117805-56715f00-ff39-11e9-9d85-93aa052c2214.png\"/></p>\n", 
      "date_published": "2019-11-04T11:31:46+00:00", 
      "title": "Webpack build \u51fa\u6765\u7684 CSS \u5185\u8d44\u6e90\u8def\u5f84\u4e0e dev-server \u8c03\u8bd5\u7684\u65f6\u5019\u4e0d\u4e00\u6837\uff1f", 
      "id": "https://www.v2ex.com/t/616204"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/e8c47a0d", 
        "name": "e8c47a0d", 
        "avatar": "https://cdn.v2ex.com/avatar/d477/5646/180258_large.png?m=1467619761"
      }, 
      "url": "https://www.v2ex.com/t/481035", 
      "title": "\u4e0d\u4e86\u89e3 WebAssembly \u548c webpack \u7684\u5173\u8054", 
      "id": "https://www.v2ex.com/t/481035", 
      "date_published": "2018-08-18T12:22:05+00:00", 
      "content_html": "\u76f4\u89c9\u4e0a\u7684\u7406\u89e3\u662f\uff0c\u4eca\u540e\u6253\u5305\u540e\u7684\u5c31\u4e0d\u662f js \u800c\u662f wasm \uff1f\u8fd8\u662f\u6211\u7406\u89e3\u9519\u4e86\u2026\u2026\uff1f"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/clino", 
        "name": "clino", 
        "avatar": "https://cdn.v2ex.com/avatar/6c1d/a886/1368_large.png?m=1335068029"
      }, 
      "url": "https://www.v2ex.com/t/463160", 
      "title": "webpack \u5de5\u7a0b\u5316\u548c vue \u5355\u6587\u4ef6\u7ec4\u4ef6\u5f00\u53d1\u4f8b\u5b50\u9879\u76ee", 
      "id": "https://www.v2ex.com/t/463160", 
      "date_published": "2018-06-14T09:32:11+00:00", 
      "content_html": "<p><a href=\"https://github.com/zhangchunlin/webpack_tutorial\" rel=\"nofollow\">https://github.com/zhangchunlin/webpack_tutorial</a></p>\n<p>\u60f3\u5b66\u4e60 webpack \u5de5\u7a0b\u5316\u548c vue \u5355\u6587\u4ef6\u7ec4\u4ef6\u5f00\u53d1\u7684\u65b0\u624b\u53ef\u4ee5\u770b\u770b</p>\n<p>\u6765\u6e90:</p>\n<ul>\n<li><a href=\"https://segmentfault.com/l/1500000009448189\" rel=\"nofollow\">Vue.js \u5b9e\u6218\u4e4b\u5de5\u7a0b\u7bc7</a>,\u4f7f\u7528\u548c\u6b64\u6559\u7a0b\u4e00\u81f4\u7684\u8303\u4f8b</li>\n<li>\u6bcf\u4e00\u6b65\u4e00\u4e2a\u63d0\u4ea4,\u53ef\u4ee5\u770b git \u5386\u53f2\u6765\u5b66\u4e60\u548c\u672c\u5730\u9a8c\u8bc1\u6d4b\u8bd5</li>\n</ul>\n<p>\u5185\u5bb9:</p>\n<ul>\n<li>\u4ece\u65e0\u5230\u6709\u5efa\u7acb\u4e00\u4e2a webpack \u9879\u76ee</li>\n<li>\u5b89\u88c5 webpack \u53ca\u76f8\u5173\u7684\u4e00\u7cfb\u5217 npm \u6a21\u5757\u548c\u5de5\u5177</li>\n<li>\u4f7f\u7528 webpack-dev-server \u4f5c\u4e3a\u8c03\u8bd5\u670d\u52a1\u5668</li>\n<li>\u6700\u7b80\u5355\u7684 webpack \u9879\u76ee</li>\n<li>webpack build</li>\n<li>\u7f16\u8bd1 css</li>\n<li>\u4f7f\u7528 ExtractTextPlugin \u5408\u5e76 css</li>\n<li>vue \u5355\u6587\u4ef6\u7ec4\u4ef6\u7684\u652f\u6301</li>\n<li>\u5bf9\u4e8e\u56fe\u7247\u6587\u4ef6\u7684\u7f16\u8bd1\u652f\u6301</li>\n<li>\u751f\u4ea7\u73af\u5883\u65b9\u5f0f\u7684 build</li>\n</ul>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/jacktesla", 
        "name": "jacktesla", 
        "avatar": "https://cdn.v2ex.com/gravatar/8e0073cf1aaeba59cde0621159611d8e?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/455201", 
      "date_modified": "2022-02-06T20:23:48+00:00", 
      "content_html": "<p>\u5c0f\u5f1f\u6211\u73b0\u5728\u4f7f\u7528 webpack+dva+wind \u914d\u7f6e\u4e00\u4e2a\u591a\u9875\u9762\u5e94\u7528\uff0c\u539f\u5148\u4f7f\u7528 sever \u5b9e\u73b0\u70ed\u66f4\u65b0\uff0c\u4f46\u662f\u73b0\u5728\u591a\u9875\u9762\u600e\u4e48\u5b9e\u73b0\u70ed\u66f4\u65b0\u6216\u8005\u65b9\u4fbf\u5f00\u53d1\u7684\u65b9\u6cd5\u3002\u6709\u5927\u795e\u6709\u5173\u4e8e\u914d\u7f6e webpack+dva \u7684\u9879\u76ee\uff0c\u53ef\u4ee5\u501f\u6211\u501f\u9274\u4e0b\u5417\uff0c\u4e0d\u80dc\u611f\u6fc0\u3002</p>\n", 
      "date_published": "2018-05-16T02:38:46+00:00", 
      "title": "\u5173\u4e8e webpack \u914d\u7f6e\u591a\u9875\u9762\u4e4b\u540e\u7684\u70ed\u66f4\u65b0\u95ee\u9898", 
      "id": "https://www.v2ex.com/t/455201"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/de6ugger", 
        "name": "de6ugger", 
        "avatar": "https://cdn.v2ex.com/gravatar/997bbd42887163685df7ed1b909e5ee3?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/383424", 
      "title": "\u5173\u4e8e webpack-dev-server \u7684\u914d\u7f6e\u95ee\u9898", 
      "id": "https://www.v2ex.com/t/383424", 
      "date_published": "2017-08-16T08:35:23+00:00", 
      "content_html": "<p>\u76f4\u63a5\u7528\u7684\u6700\u65b0\u7684 iview \u9879\u76ee\u3002</p>\n<p>\u5148\u6267\u884c npm run dist \u751f\u6210\u4e86 dist \u6587\u4ef6\u5939\uff0c</p>\n<p>\u7136\u540e\u60f3\u901a\u8fc7 npm run dev \u67e5\u770b example \u4e2d\u7684\u6548\u679c\uff0c</p>\n<p>\u7ed3\u679c css \u6b7b\u6d3b\u627e\u4e0d\u5230\uff0cindex.html \u4e2d\u7684 css \u6307\u5411\u81ea\u5df1\u4fee\u6539\u8fc7\uff0c</p>\n<p>\u5e94\u8be5\u662f\u548c webpack-dev-server \u7684\u914d\u7f6e\u6709\u5173\u7684\u5427\uff1f</p>\n<p>\u524d\u7aef\u5c0f\u83dc\u524d\u6765\u8bf7\u5927\u4f6c\u4eec\u5e2e\u6211\u6307\u5bfc\u4e00\u4e0b\u3002\n\u4e0d\u80dc\u611f\u6fc0\u3002</p>\n<p><img alt=\"\" src=\"https://i.loli.net/2017/08/16/599401eee9ec4.png\">\n<img alt=\"\" src=\"https://i.loli.net/2017/08/16/599401eeead4e.png\"></p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/ghostheaven", 
        "name": "ghostheaven", 
        "avatar": "https://cdn.v2ex.com/gravatar/aa096242e01509440346de42356751b7?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/373974", 
      "title": "webpack \u7684\u5b98\u65b9 node-loader \u662f\u653e\u5f03\u6cbb\u7597\u4e86\u5417", 
      "id": "https://www.v2ex.com/t/373974", 
      "date_published": "2017-07-08T12:21:16+00:00", 
      "content_html": "\u6253\u5305\u540e\u5c45\u7136\u7528\u7684\u662f native module \u7684\u7edd\u5bf9\u8def\u5f84\uff0c\u8fd9\u662f\u653e\u5f03\u6cbb\u7597\u4e86\u5417\uff1f\r<br />\r<br />\u5e78\u597d\u8fd8\u6709\u4e2a node-native-loader \u53ef\u4ee5\u7528"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/lxy", 
        "name": "lxy", 
        "avatar": "https://cdn.v2ex.com/gravatar/b657ab399e8be52cec2a2867bbc4f662?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/366900", 
      "title": "\u53ea\u7f16\u8bd1 Pug \u65f6\u914d\u7f6e\u5e94\u8be5\u600e\u4e48\u5199\uff1f", 
      "id": "https://www.v2ex.com/t/366900", 
      "date_published": "2017-06-08T03:47:26+00:00", 
      "content_html": "\u65b0\u624b\u3002Webpack \u8981\u6c42\u6709 entry\uff0c\u4f46\u662f\u6211\u6682\u65f6\u6ca1\u5199\u4efb\u4f55 js \u6587\u4ef6\uff0c\u6307\u5b9a\u5165\u53e3\u6ca1\u4ec0\u4e48\u610f\u4e49\uff0c\u5728\u5355\u7eaf\u53ea\u7f16\u8bd1\u4e00\u5806 Pug \u6587\u4ef6\u65f6\u914d\u7f6e\u5e94\u8be5\u600e\u4e48\u5199\uff1f"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/dxcqcv", 
        "name": "dxcqcv", 
        "avatar": "https://cdn.v2ex.com/gravatar/217c4134e1eb90183a637bf0874b0a2b?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/364698", 
      "date_modified": "2017-06-05T06:37:14+00:00", 
      "content_html": "<p>\u95ee\u9898\u4e00\nwebpack \u6253\u5305\u51fa\u6765\u7684 js \u5982\u4f55\u6253\u65ad\u70b9 debug \uff1f\u5df2\u7ecf\u5f00\u542f sourcemap</p>\n<p>\u5f15\u7533\u95ee\u9898\uff0c\u5982\u679c\u662f webpack-dev-server \u91cc\u7684 js \u56e0\u4e3a\u662f\u5728\u5185\u5b58\u4e2d\u662f\u4e0d\u662f\u66f4\u65e0\u6cd5 debug \u6253\u65ad\u70b9\u4e86\uff1f</p>\n<p>\u95ee\u9898\u4e8c\nfirefox \u5347\u7ea7\u5230 53 \u540e\uff0credux-devtools-extension \u65e0\u6cd5\u8c03\u51fa\u662f\u4e0d\u662f\u666e\u904d\u73b0\u8c61\uff1f\u6839\u672c\u627e\u4e0d\u5230\u90a3\u4e2a\u8f6e\u56de\u773c\u7684 icon \u4e86\uff0c\u662f\u4e0d\u662f\u56e0\u4e3a\u5f00\u542f\u4e86 firefox \u7684\u667a\u80fd\u641c\u7d22\u63d0\u793a\u5462\uff1f</p>\n<p>\u8c22\u8c22\u5927\u5bb6</p>\n", 
      "date_published": "2017-05-30T02:48:11+00:00", 
      "title": "webpack \u548c redux \u8c03\u8bd5\u95ee\u9898", 
      "id": "https://www.v2ex.com/t/364698"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/simonlify", 
        "name": "simonlify", 
        "avatar": "https://cdn.v2ex.com/avatar/6bc8/4d2b/146207_large.png?m=1467171608"
      }, 
      "url": "https://www.v2ex.com/t/294146", 
      "date_modified": "2017-06-05T06:37:46+00:00", 
      "content_html": "\u672c\u4eba\u6700\u8fd1\u5728\u5b66 React+webpack+ES6 \u7684\u524d\u7aef\u9879\u76ee\u7ec4\u4ef6\u5316\u5f00\u53d1\uff0c\u4f46\u662f\u5728\u7528 npm \u7f16\u8bd1 webpack \u7684\u914d\u7f6e\u6587\u4ef6\u65f6\u78b0\u5230\u4e86\u5982\u4e0b\u9519\u8bef\uff0c webpack.config.js alias \u914d\u7f6e\u5982\u4e0b\uff1a\r<br />\r<br />\u90e8\u5206\u4ee3\u7801\uff1a\r<br />var alias = pickFiles({\r<br />  id: /(conf\\/[^\\/]+).js$/,\r<br />  pattern: SRC_PATH + '/conf/*.js'\r<br />});\r<br />\r<br />alias = Object.assign(alias, pickFiles({\r<br />  id: /(components\\/[^\\/]+)/,\r<br />  pattern: SRC_PATH + '/components/*/index.js'\r<br />}));\r<br />\r<br />\u62a5\u9519\u5982\u4e0b:\r<br />alias = Object.assign(alias, pickFiles({\r<br />               ^\r<br />TypeError: undefined is not a function\r<br />\r<br />\u6211\u5728\u7f51\u4e0a\u627e\u8fc7\u89e3\u51b3\u529e\u6cd5\uff0c\u90fd\u8bf4\u8fd9\u4e2a\u662f ES6 \u7684\u8bed\u6cd5\uff0c\u9700\u8981\u88c5\u76f8\u5173\u63d2\u4ef6\u53bb\u8f6c\u6210 ES5,\u4e8e\u662f\u4e4e\u6211\u88c5\u4e86\u4e00\u4e9b\u5217\u7684\u63d2\u4ef6\uff0c\u4f46\u90fd\u4e8e\u4e8b\u65e0\u8865\uff0c\u6545\u60f3\u8bf7\u6559\u4e0b\u5404\u4f4d\uff01\r<br />\u5e0c\u671b\u7ed9\u51fa\u5177\u4f53\u7684\u89e3\u51b3\u529e\u6cd5\uff0c\u8c22\u8c22\uff01", 
      "date_published": "2016-07-22T03:29:06+00:00", 
      "title": "\u5173\u4e8e webpack \u548c ES6 \u7684\u95ee\u9898", 
      "id": "https://www.v2ex.com/t/294146"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/eromoe", 
        "name": "eromoe", 
        "avatar": "https://cdn.v2ex.com/gravatar/4f30a3d3b23cf96bacea4a197f6bbb71?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/289114", 
      "date_modified": "2017-06-05T06:37:42+00:00", 
      "content_html": "<p>\u6211\u73b0\u5728\u7528 webpack  devserver \u641e\u4e2a react \u7684\u4e1c\u897f</p>\n<p>\u7ed3\u6784\u5982\u4e0b</p>\n<img src=\"http://i.stack.imgur.com/zwqoq.png\">\n<p>\u600e\u4e48\u80fd\u5728 main.scss  import \u76f8\u5bf9\u8def\u5f84 \u7684 scss \u6587\u4ef6\uff1f</p>\n<p><code>@import 'font-awesome/font-awesome.scss';</code> \u4e00\u65e6\u5199\u8fdb\u53bb\uff0c webpack devserver  \u5c31\u5f00\u59cb\u62a5\u9519\u4e86\uff0c\n\u53ea\u6709\u653e\u5230 index.js \u91cc import \u624d\u884c</p>\n<p>so \u4e0a\u4e5f\u6709\u7c7b\u4f3c\u95ee\u9898 <a href=\"http://stackoverflow.com/questions/33649761/how-do-i-load-font-awesome-using-scss-sass-in-webpack-using-relative-paths\" rel=\"nofollow\">http://stackoverflow.com/questions/33649761/how-do-i-load-font-awesome-using-scss-sass-in-webpack-using-relative-paths</a></p>\n<p>\u6ca1\u6709\u89e3\u51b3\u529e\u6cd5</p>\n<p>webpack \u914d\u7f6e\uff1a</p>\n<pre><code>const path = require('path');\nconst webpack = require('webpack');\n\nmodule.exports = {\n  devtool: 'cheap-module-eval-source-map',\n  entry: [\n    'eventsource-polyfill', // necessary for hot reloading with IE\n    'webpack-hot-middleware/client',\n    './src/index'\n  ],\n  output: {\n    path: path.join(__dirname, 'dist'),\n    filename: 'bundle.js',\n    publicPath: '/static/'\n  },\n  plugins: [\n    /**\n     * This is where the magic happens! You need this to enable Hot Module Replacement!\n     */\n    new webpack.HotModuleReplacementPlugin(),\n    /**\n     * NoErrorsPlugin prevents your webpack CLI from exiting with an error code if\n     * there are errors during compiling - essentially, assets that include errors\n     * will not be emitted. If you want your webpack to 'fail', you need to check out\n     * the bail option.\n     */\n    new webpack.NoErrorsPlugin(),\n    /**\n     * DefinePlugin allows us to define free variables, in any webpack build, you can\n     * use it to create separate builds with debug logging or adding global constants!\n     * Here, we use it to specify a development build.\n     */\n    new webpack.DefinePlugin({\n      'process.env.NODE_ENV': JSON.stringify('development')\n    }),\n  ],\n  module: {\n    loaders: [\n      {\n        test: /\\.js?/,\n        exclude: [/node_modules/, /styles/],\n        loaders: ['babel'],\n        include: path.join(__dirname, 'src')\n      },\n      {\n        test: /\\.scss$/,\n        loader: 'style!css!sass'\n      },\n      {\n        test: /\\.css$/,\n        loader: \"style-loader!css-loader\"\n      },\n      {\n        test: /\\.woff(2)?(\\?v=[0-9]\\.[0-9]\\.[0-9])?$/,\n        loader: 'url-loader?limit=10000&amp;mimetype=application/font-woff'\n      },\n      {\n        test: /\\.(ttf|eot|svg)(\\?v=[0-9]\\.[0-9]\\.[0-9])?$/,\n        loader: 'file-loader'\n      }\n    ]\n  }\n};\n\n</code></pre>\n<p>\u6211\u53ea\u61c2\u57fa\u672c\u7684webpack\u914d\u7f6e\uff0c \u5c1d\u8bd5\u4e86\u4e0b\u6539 entry \u548coutput \u90fd\u6ca1\u5565\u7528\u3002\u3002\u3002</p>\n", 
      "date_published": "2016-06-29T06:45:37+00:00", 
      "title": "\u600e\u4e48\u5728 webpack devserver \u91cc \u7528\u76f8\u5bf9\u8def\u5f84 import scss(font-awesome)?", 
      "id": "https://www.v2ex.com/t/289114"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/NicholasNC", 
        "name": "NicholasNC", 
        "avatar": "https://cdn.v2ex.com/avatar/f949/6bec/151349_large.png?m=1728962224"
      }, 
      "url": "https://www.v2ex.com/t/286262", 
      "date_modified": "2017-06-05T06:37:07+00:00", 
      "content_html": "<p>\u81ea\u5b66 react+redux \uff0c\u6559\u7a0b\u57fa\u672c\u4e0a\u90fd\u662f\u7528 ES6 \u5199\u7684\uff0c\u5e76\u4e14\u7528 webpack \u7ba1\u7406\u4f9d\u8d56\u3001\u6253\u5305\uff08\u6211\u7684 webpack \u662f 0 \u57fa\u7840\uff0c\u57fa\u672c\u4e0d\u4f1a\u7528\uff0c\u53ea\u662f\u770b\u4e86\u4e00\u4e9b\u5feb\u901f\u5165\u95e8\u6559\u7a0b\uff09\u3002</p>\n<p>\u73b0\u5728\u6709\u4e2a\u56f0\u60d1\uff0c\u600e\u6837\u8c03\u8bd5 webpack \u6253\u5305\u597d\u7684\u4ee3\u7801\uff1f webpack \u6253\u5305\u597d\u7684 bundle.js \uff0c\u4e00\u8138\u832b\u7136\uff0c\u6839\u672c\u770b\u4e0d\u61c2\uff0c\u66f4\u52a0\u4e0d\u7528\u8bf4\u8c03\u8bd5\u3002</p>\n<p>\u4e0d\u77e5\u5927\u795e\u6709\u6ca1\u6709\u6bd4\u8f83\u597d\u7684\u5efa\u8bae\u3002\u6307\u70b9\u6307\u70b9\u4e00\u4e0b\u5c0f\u5f1f</p>\n", 
      "date_published": "2016-06-16T11:29:09+00:00", 
      "title": "\u600e\u6837\u8c03\u8bd5 Webpack \u6253\u5305\u597d\u7684\u4ee3\u7801\u5417\uff1f", 
      "id": "https://www.v2ex.com/t/286262"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/cxh116", 
        "name": "cxh116", 
        "avatar": "https://cdn.v2ex.com/avatar/7e7a/41b8/13872_large.png?m=1775747136"
      }, 
      "url": "https://www.v2ex.com/t/278255", 
      "date_modified": "2017-06-05T06:37:28+00:00", 
      "content_html": "<p><a href=\"https://webpack.github.io/docs/code-splitting.html#split-app-and-vendor-code\" rel=\"nofollow\">https://webpack.github.io/docs/code-splitting.html#split-app-and-vendor-code</a>\n\u53c2\u8003\u6b64\u6587\u7684 \"Split app and vendor code\" , \u80fd\u628a js \u6587\u4ef6\u5206\u79bb\u51fa\u6765,\u4f46 css \u65e0\u6548</p>\n<p>\u6211\u7684 webpack \u914d\u7f6e</p>\n<pre><code>var webpack = require(\"webpack\");\nvar ExtractTextPlugin = require(\"extract-text-webpack-plugin\");\n\nmodule.exports = {\n  entry: {\n    app: \"./entry.js\",\n    vendor: ['bootstrap'],\n  },\n    output: {\n        path: __dirname + \"/dist\",\n        filename: \"bundle.js\"\n    },\n    module: {\n        loaders: [\n        { test: /\\.less$/, loader: ExtractTextPlugin.extract(\"style-loader\", \"css-loader!less-loader\")},\n        { test: /\\.css$/, loader:  ExtractTextPlugin.extract(\"style-loader\", \"css-loader\") },\n        { test: /\\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' },\n        ]\n    },\n    plugins: [\n      new webpack.optimize.CommonsChunkPlugin(/* chunkName= */\"vendor\", /* filename= */\"vendor.bundle.js\"),\n      new ExtractTextPlugin(\"[name].bundle.css\", {allChunks: false}),\n    ]\n};\n</code></pre>\n<p>\u80fd\u751f\u6210 vendor.bundle.js \u6587\u4ef6,\u4e14\u6587\u4ef6\u5185\u5bb9\u5305\u542b bootstrap . \u4f46\u6ca1\u6709\u751f\u6210 vendor.bundle.css \u6587\u4ef6.\n\u662f extract-text-webpack-plugin \u4e0d\u652f\u6301\u5417?</p>\n<p>\u60f3\u5230\u4e00\u79cd\u6bd4\u8f83\u7b28\u7684\u529e\u6cd5,\u5c31\u662f\u518d\u5efa\u4e00\u4e2a css_entry.js \u6587\u4ef6, \u5728\u6587\u4ef6\u91cc\u9762\u8c03\u7528  <code>require('./node_modules/bootstrap/less/bootstrap.less')</code> ,\u4f46\u611f\u89c9\u8fd9\u4e2a\u529e\u6cd5\u6709\u70b9\u6413...</p>\n<p>\u6709\u4ec0\u4e48\u66f4\u597d\u89e3\u51b3\u65b9\u6848\u7684\u670b\u53cb\u5417?</p>\n", 
      "date_published": "2016-05-12T10:44:10+00:00", 
      "title": "webpack \u7684 Code Splitting \u4e0d\u652f\u6301\u7b2c\u4e09\u65b9 css \u5417?", 
      "id": "https://www.v2ex.com/t/278255"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/shuson", 
        "name": "shuson", 
        "avatar": "https://cdn.v2ex.com/avatar/2562/e666/29065_large.png?m=1565256978"
      }, 
      "url": "https://www.v2ex.com/t/230137", 
      "date_modified": "2017-06-05T06:37:00+00:00", 
      "content_html": "<p>\u4e3a\u4e86\u8ddf\u4e0a\u524d\u7aef\u754c\u6309\u5468\u66f4\u65b0\u6280\u80fd\u7684\u5468\u671f\uff0c\u770b\u5230\u5f88\u591a react \u9879\u76ee\u5728\u4f7f\u7528 webpack \uff0c\u6211\u4e5f\u624b\u75d2\u3002\u4e8e\u662f\u4e4e\u8bd5\u8bd5\u3002</p>\n\n<p>\u95ee\u9898 1 \uff1a webpack \u65e2\u7136\u548c browserify \u662f\u4e00\u4e2a\u7c7b\u578b\u7684\uff0c\u5f53\u7136\uff0c\u5f3a\u5927\u4e86\u8bb8\u591a\uff0c\u5c45\u7136\u53ef\u4ee5\u628a css \u4e5f\u5f53\u505a\u4e86 compile to js \u6765\u4f7f\u7528\u3002 gulp \u4e5f\u6709\u5f88\u591a\u63d2\u4ef6\u5b8c\u6210 coffee script \u6216\u8005 es6 \u5230 js \u7684\u8fc7\u7a0b\u3002\u4e3a\u4f55\u8fd9\u4e2a\u8f6e\u5b50\u9020\u51fa\u6765\u4e86\u3002\u96be\u9053\u662f\u4e3a\u4e86\u7edf\u4e00 AMD \u548c commonjs \u4e0d\u540c module loading \u95ee\u9898\uff1f</p>\n\n<p>\u95ee\u9898 2 \uff1a learning curve \u6709\u70b9\u9661\u554a\uff0c\u4e0d\u50cf gulp \u4e00\u4e0a\u5348\u5c31\u77e5\u9053\u600e\u4e48\u7528\u4e86\u3002 \u5c0f\u9879\u76ee\u4f7f\u7528\u662f\u4e0d\u662f\u6709\u70b9\u8fc7\uff1f</p>\n\n<p>\u611a\u89c1\uff0c\u55b7\u5427\uff0c\u53cd\u6b63\u4e5f\u662f\u5b66\u4e60\u3002</p>\n", 
      "date_published": "2015-10-22T04:16:55+00:00", 
      "title": "\u524d\u7aef\u8f6e\u5b50\u4eec\uff1a gulp \u548c webpack \u662f\u4e0d\u662f\u6709\u529f\u80fd\u4e0a\u7684 overlap", 
      "id": "https://www.v2ex.com/t/230137"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/mysoko", 
        "name": "mysoko", 
        "avatar": "https://cdn.v2ex.com/avatar/35d0/2fef/4220_large.png?m=1353423824"
      }, 
      "url": "https://www.v2ex.com/t/198538", 
      "date_modified": "2017-06-05T06:37:32+00:00", 
      "content_html": "", 
      "date_published": "2015-06-14T15:45:31+00:00", 
      "title": "gulp \u548c webpack \u533a\u522b", 
      "id": "https://www.v2ex.com/t/198538"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/phx13ye", 
        "name": "phx13ye", 
        "avatar": "https://cdn.v2ex.com/gravatar/e589f3bcac3d146c80b717b18c16ac1e?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/196965", 
      "date_modified": "2017-06-05T06:37:04+00:00", 
      "content_html": "\u5728HTML\u6587\u4ef6\u4e2d\u5982\u679c\u6709\r<br />```html\r<br />&lt;script src=&quot;./src/js/A.js&quot;&gt;&lt;/script&gt;\r<br />&lt;script src=&quot;./src/js/B.js&quot;&gt;&lt;/script&gt;\r<br />```\r<br />wepack\u4e4b\u540e\uff0cA\uff0cB\u7684\u6e90\u7801\u5408\u5e76\u5e76\u538b\u7f29\u4e3abundle.js\r<br />\u6709\u4ec0\u4e48\u65b9\u6cd5\u53ef\u4ee5\u6539\u4e3a\r<br />```html\r<br />&lt;script src=&quot;./build/js/bundle.js&quot;&gt;&lt;/script&gt;\r<br />```", 
      "date_published": "2015-06-08T08:42:37+00:00", 
      "title": "Webpack \u600e\u4e48\u6539 html \u4e2d\u7684 js \u8def\u5f84\uff1f", 
      "id": "https://www.v2ex.com/t/196965"
    }
  ]
}