mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
36 lines
767 B
JavaScript
36 lines
767 B
JavaScript
|
const resolve = require('path').resolve
|
||
|
const webpack = require('webpack')
|
||
|
|
||
|
module.exports = {
|
||
|
entry: './client/next-prefetcher.js',
|
||
|
output: {
|
||
|
filename: 'next-prefetcher-bundle.js',
|
||
|
path: resolve(__dirname, 'dist/client')
|
||
|
},
|
||
|
plugins: [
|
||
|
new webpack.DefinePlugin({
|
||
|
'process.env': {
|
||
|
NODE_ENV: JSON.stringify('production')
|
||
|
}
|
||
|
})
|
||
|
],
|
||
|
module: {
|
||
|
rules: [{
|
||
|
test: /\.js$/,
|
||
|
exclude: /node_modules/,
|
||
|
loader: 'babel-loader',
|
||
|
options: {
|
||
|
babelrc: false,
|
||
|
presets: [
|
||
|
['env', {
|
||
|
targets: {
|
||
|
// All browsers which supports service workers
|
||
|
browsers: ['chrome 49', 'firefox 49', 'opera 41']
|
||
|
}
|
||
|
}]
|
||
|
]
|
||
|
}
|
||
|
}]
|
||
|
}
|
||
|
}
|