-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathwebpack.config.js
54 lines (53 loc) · 1.72 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
51
52
53
54
var webpack = require('webpack');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var CleanWebpackPlugin = require('clean-webpack-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: {
background: "./src/js/background.js",
popup: "./src/js/popup.js",
options: "./src/js/options.js"
},
output: {
filename: "public/[name].js"
},
plugins: [
new ExtractTextPlugin("public/[name].css"),
new CopyWebpackPlugin([
{ from: './manifest.json', to: './public/' },
{ from: './notification.mp3', to: './public/' },
{ from: './icon.png', to: './public/' },
{ from: './notification-icon.png', to: './public/' },
{ from: './src/fonts', to: './public/fonts' },
{ from: './src/css', to: './public' },
{ from: './src/views', to: './public' }
]),
new CleanWebpackPlugin(['public']),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurrenceOrderPlugin()
],
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/,
query: {
presets: ['es2015']
}
},
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
loader: 'file-loader?name=fonts/[name].[ext]'
},
{
test: /\.json$/,
loader: 'json-loader'
},
{
test: /\.sass$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader?-url!sass-loader')
}
]
}
}