forked from nsjames/Scatter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
50 lines (47 loc) · 2.03 KB
/
webpack.config.js
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
46
47
48
49
50
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const IgnoreEmitPlugin = require('ignore-emit-webpack-plugin');
const ZipPlugin = require('zip-webpack-plugin');
module.exports = {
entry: {
'background.js': path.resolve(__dirname, './src/background.js'),
'popup.js': path.resolve(__dirname, './src/popup.js'),
'content.js': path.resolve(__dirname, './src/content.js'),
'inject.js': path.resolve(__dirname, './src/inject.js'),
'styles.css': path.resolve(__dirname, './src/sass/styles.scss'),
'index.omit': path.resolve(__dirname, './src/index.html'),
'icon.omit': path.resolve(__dirname, './src/icon.png'),
'prompt.js': path.resolve(__dirname, './src/prompt.js'),
'prompt.omit': path.resolve(__dirname, './src/prompt.html'),
'manifest.omit': path.resolve(__dirname, './src/manifest.json'),
},
output: {
path: path.resolve(__dirname, './build'),
filename: '[name]'
},
resolve: {
alias: {
vue: 'vue/dist/vue.js',
scatterdapp: path.join(__dirname, "node_modules/scatterdapp"),
scattermodels: path.join(__dirname, "node_modules/scattermodels")
},
modules: [ path.join(__dirname, "node_modules") ]
},
module: {
loaders: [
{ test: /\.js$/, loader: 'babel-loader', query: { presets: ['es2015'] },exclude: /node_modules/ }
],
rules:[
{ test: /\.(sass|scss)$/, loader: ExtractTextPlugin.extract(['css-loader', 'sass-loader']) },
{ test: /\.(html|png)$/, loader: 'file-loader', options: { name: '[name].[ext]' } },
{ test: /\.vue$/, loader: 'vue-loader', options: { loaders: { js: 'babel-loader' } } }
]
},
plugins: [
new ExtractTextPlugin({ filename: '[name]', allChunks: true, }),
new IgnoreEmitPlugin(/\.omit$/),
new ZipPlugin({ path: '../', filename: 'scatter.zip', })
],
stats: { colors: true },
devtool: 'inline-source-map'
}