Skip to content

Instantly share code, notes, and snippets.

@bakoushin
Last active February 12, 2018 17:24
Show Gist options
  • Save bakoushin/376f2c017c1cb7038189783611ee463f to your computer and use it in GitHub Desktop.
Save bakoushin/376f2c017c1cb7038189783611ee463f to your computer and use it in GitHub Desktop.
Service Worker webpack config
const path = require('path');
const BabiliPlugin = require('babili-webpack-plugin');
module.exports {
entry: {
'bundle.min': './src/index.js',
'sw': './src/sw.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js'
},
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }
]
},
plugins: [
new BabiliPlugin({}, {
test: /\.js$/,
exclude: /node_modules/,
comments: false,
babel: require("babel-core"),
babili: require("babel-preset-babili")
})
],
watch: true,
watchOptions: {
aggregateTimeout: 300,
poll: 1000,
ignored: /node_modules/
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment