-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
45 lines (43 loc) · 1.46 KB
/
webpack.config.js
File metadata and controls
45 lines (43 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var ROOT_PATH = path.resolve(__dirname);
var APP_PATH = path.resolve(ROOT_PATH, 'src');
var BUILD_PATH = path.resolve(ROOT_PATH, 'dist');
module.exports = {
entry: {
'background': './src/background.js'
, 'devtools': ['./src/devtools.js', './src/devtools.html']
, 'content-script': './src/site/content-script.js'
, 'panel': ['./src/panel/panel.js','./src/panel/panel.html']
, 'manifest':'./src/manifest.json'
},
output: {
path: BUILD_PATH,
filename: '[name].js',
//libraryTarget: 'this'
},
resolveLoader: {
root: path.join(__dirname, 'node_modules')
},
// resolve:{
// alias:{
// 'nflow':'nflow/src'
// }
// },
module: {
noparse: [ /nflow$/, /nflow-vis/ ],
loaders: [
{ test: /\.js$/
, exclude: [/node_modules/, /nflow$/, /nflow-vis/]
, loader: 'babel'
, query: { presets: ['es2015', 'stage-0'] }
},
{ test: /\.(css|scss)$/, loader: ExtractTextPlugin.extract("style-loader", ["css-loader", "sass-loader"]) },
{ test: /\.(html|json|png)/, loader: 'file?name=[name].[ext]' },
{ test: /.(png|woff(2)?|eot|ttf|svg)(\?[a-z0-9=\.]+)?$/, loader: 'url-loader?limit=100000' }
]
},
plugins: [
new ExtractTextPlugin("panel.css"),
]
};