|
1 | | -const webpack = require('webpack'); |
2 | | -const CopyWebpackPlugin = require('copy-webpack-plugin'); |
| 1 | +const webpack = require("webpack"); |
| 2 | +const CopyWebpackPlugin = require("copy-webpack-plugin"); |
3 | 3 |
|
4 | 4 | module.exports = { |
5 | 5 | entry: { |
6 | | - content_script: './content-scripts/App.jsx', |
7 | | - background: './src/background.js', |
8 | | - popup: './popup-page/App.jsx', |
9 | | - option: './option-page/App.jsx', |
| 6 | + content_script: "./content-scripts/App.jsx", |
| 7 | + background: "./src/background.js", |
| 8 | + popup: "./popup-page/App.jsx", |
| 9 | + option: "./option-page/App.jsx" |
10 | 10 | }, |
11 | 11 | module: { |
12 | 12 | rules: [ |
13 | 13 | { |
14 | 14 | test: /\.(js|jsx)$/, |
15 | 15 | exclude: /node_modules/, |
16 | | - use: ['babel-loader'] |
| 16 | + use: ["babel-loader"] |
17 | 17 | }, |
18 | 18 | { |
19 | 19 | test: /\.(gif|png|jpe?g|svg)$/i, |
20 | 20 | use: [ |
21 | | - 'file-loader', |
| 21 | + "file-loader", |
22 | 22 | { |
23 | | - loader: 'image-webpack-loader', |
| 23 | + loader: "image-webpack-loader", |
24 | 24 | options: { |
25 | 25 | bypassOnDebug: true, // webpack@1.x |
26 | | - disable: true, // webpack@2.x and newer |
27 | | - }, |
28 | | - }, |
| 26 | + disable: true // webpack@2.x and newer |
| 27 | + } |
| 28 | + } |
29 | 29 | ] |
30 | 30 | } |
31 | 31 | ] |
32 | 32 | }, |
33 | 33 | resolve: { |
34 | | - extensions: ['*', '.js', '.jsx'] |
| 34 | + extensions: ["*", ".js", ".jsx"] |
35 | 35 | }, |
36 | 36 | output: { |
37 | | - path: __dirname + '/dist', |
38 | | - publicPath: '/', |
39 | | - filename: '[name].bundle.js' |
| 37 | + path: __dirname + "/dist", |
| 38 | + publicPath: "/", |
| 39 | + filename: "[name].bundle.js" |
40 | 40 | }, |
41 | 41 | plugins: [ |
42 | | - new CopyWebpackPlugin([ |
43 | | - { from: './popup-page/popup.html', force: true } , |
44 | | - { from: './option-page/option.html', force: true } , |
45 | | - { from: './src/app/', force: true } |
46 | | - ], {}), |
| 42 | + new CopyWebpackPlugin( |
| 43 | + [ |
| 44 | + { from: "./popup-page/popup.html", force: true }, |
| 45 | + { from: "./option-page/option.html", force: true }, |
| 46 | + { from: "./src/app/", force: true } |
| 47 | + ], |
| 48 | + {} |
| 49 | + ), |
47 | 50 | new webpack.HotModuleReplacementPlugin() |
48 | 51 | ], |
49 | 52 | devServer: { |
50 | | - contentBase: './dist', |
| 53 | + contentBase: "./dist", |
51 | 54 | hot: true |
52 | 55 | } |
53 | 56 | }; |
0 commit comments