You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
like what we did in [Babel Config](#babel-config). Note that disabling Babel's module plugin is not only necessary for HMR. If you don't disable it you'll run into many other issues (see [Migrating from v1 to v2](/guides/migrating/#mixing-es2015-with-amd-and-commonjs)and[webpack-tree-shaking](http://www.2ality.com/2015/12/webpack-tree-shaking.html)).
4. Note that if you're using ES6 modules in your webpack 2 configuration file, and you change your `.babelrc` file in #3 above, you either need to use `require` or create two `.babelrc` files (issue [here](https://github.com/webpack/webpack.js.org/issues/154)):
223
-
* One in the project root directory with `"presets": ["es2015"]
224
-
* One in the home directory for webpack to build. For this example, in `src/`.
So in this case, `module.hot.accept` will fire the `render` method whenever `src/components/App.js` or its dependencies are changed - which means the `render` method will also fire when the `App.css` is changed, since `App.css` is included in `App.js`.
227
230
228
231
### index.html
229
232
230
-
This needs to be placed inside of `dist` in your project root. webpack-dev-server will not run without it.
API 从版本1起已经改变。用于 webpack 1 的版本,请看[the README in the webpack-1 branch](https://github.com/webpack/extract-text-webpack-plugin/blob/webpack-1/README.md)。
|[commons-chunk-plugin](/plugins/commons-chunk-plugin)|Generates chunks of common modules shared between entry points and splits them into separate bundles, e.g., `1vendor.bundle.js`&&`app.bundle.js`|
12
-
|[extract-text-webpack-plugin](/plugins/extract-text-webpack-plugin)|Extracts Text (CSS) from your bundles into a separate file (app.bundle.css)|
13
-
|[component-webpack-plugin](/plugins/component-webpack-plugin)|Use components with webpack|
14
-
|[compression-webpack-plugin](/plugins/compression-webpack-plugin)|Prepare compressed versions of assets to serve them with Content-Encoding|
15
-
|[i18n-webpack-plugin](/plugins/i18n-webpack-plugin)|Adds i18n support to your bundles|
16
-
|[html-webpack-plugin](/plugins/html-webpack-plugin)|Simplifies creation of HTML files (`index.html`) to serve your bundles|
Copy file name to clipboardExpand all lines: content/plugins/source-map-dev-tool-plugin.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,19 @@ contributors:
6
6
7
7
?> Review this content
8
8
9
-
Adds SourceMaps for assets.
9
+
给资源添加 SourceMap。
10
10
11
11
```javascript
12
12
newwebpack.SourceMapDevToolPlugin(options)
13
13
```
14
14
15
-
*`options.test` / `options.include` / `options.exclude` (`string|RegExp|Array`): Used to determine which assets should be processed. Each one can be a `RegExp` (asset filename is matched), a `string` (asset filename need to start with this string) or an `Array` of those (any of them need to be matched). `test`defaults to `.js`files if omitted.
16
-
*`options.filename` (`string`): defines the output filename of the SourceMap. If no value is provided the SourceMap is inlined.
17
-
*`options.append` (`string`): is appended to the original asset. Usually the `#sourceMappingURL`comment. `[url]` is replaced with a URL to the SourceMap file. `false`disables the appending.
*`options.module` (`boolean`): (defaults to `true`) When`false` loaders do not generate SourceMaps and the transformed code is used as source instead.
20
-
*`options.columns` (`boolean`): (defaults to `true`) When `false` column mappings in SourceMaps are ignored and a faster SourceMap implementation is used.
21
-
*`options.lineToLine` (`{test: string|RegExp|Array, include: string|RegExp|Array, exclude: string|RegExp|Array}`matched modules uses simple (faster) line to line source mappings.
0 commit comments