Files
web2.0-frontend/configs/webpack/prod.js
T
2018-06-20 16:04:12 +03:00

27 lines
697 B
JavaScript

// production config
const merge = require('webpack-merge');
const path = require('path')
const resolve = path.resolve;
const PrerenderSPAPlugin = require('prerender-spa-plugin');
const commonConfig = require('./common');
module.exports = merge(commonConfig, {
mode: 'production',
entry: './index.tsx',
output: {
filename: 'js/bundle.[hash].min.js',
path: resolve(__dirname, '../../dist'),
publicPath: '/',
},
devtool: 'source-map',
plugins: [
new PrerenderSPAPlugin({
// Required - The path to the webpack-outputted app to prerender.
staticDir: resolve(__dirname, '../../dist'),
// Required - Routes to render.
routes: ['/'],
})
],
});