-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
52 lines (52 loc) · 1.41 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
module.exports = {
// Main script
entry: './src/lib/pushy.js',
// Output params
output: {
path: 'build',
library: 'Pushy',
publicPath: 'build/',
filename: 'pushy-sdk.js'
},
module: {
// ESLint - code linter
preLoaders: [
{
test: /\.js$/,
exclude: /node_modules|plugins/,
loader: 'eslint'
}
],
loaders: [
// Babel - transpiler
{
test: /\.js$/,
exclude: /node_modules|plugins/,
loader: 'babel',
query: {
presets: ['es2015'],
plugins: ['syntax-async-functions', 'transform-regenerator'],
compact: true
}
},
// Bundle page assets (images/fonts/svgs)
{
test: /\.(png|gif|jpg|jpeg|woff|woff2|eot|ttf|svg|cur)/,
loader: 'url-loader?limit=10000&name=./assets/[hash].[ext]'
},
// Bundle CSS stylesheets
{
test: /\.css$/,
exclude: /node_modules/,
loader: 'style-loader!css-loader'
}
]
},
// Configuration for webpack-dev-server
devServer: {
port: 8000,
inline: true,
host: '0.0.0.0',
historyApiFallback: true
}
};