1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/webpack.config.js
Luke Edwards 839fb1c05c [WIP] Migrate from Gulp to Fly (#965)
* install fly & plugins

* start flyfile conversion

* install node-notifier directly

* send task notifications

* upgrade to fly@2.0.1

* fix watch rebuilds

* compile in parallel

* remove gulp-related deps

* enable start|stop-chromedriver

* run build before watching

* extract webpack config

* fix webpack build

* use serial chain within 'build' -- faster

* update to fly-watch@1.1.0

* generate new yarn.lock after rebase

* rename tasks; use fly-esnext (async/await)

* bump fly deps (node4 supp)

* remove destructured assignment

* import latest package.json changes
2017-02-09 20:33:08 +01:00

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']
}
}]
]
}
}]
}
}