Add prerendering
This commit is contained in:
parent
0242722268
commit
a42591c701
6 changed files with 1009 additions and 48 deletions
|
|
@ -1,5 +1,6 @@
|
|||
const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const isProduction = argv.mode === 'production';
|
||||
|
|
@ -10,7 +11,7 @@ module.exports = (env, argv) => {
|
|||
path: path.resolve(__dirname, 'dist'),
|
||||
filename: 'bundle.js',
|
||||
clean: true,
|
||||
|
||||
|
||||
// Empty string generates relative paths that work through proxies
|
||||
publicPath: '',
|
||||
},
|
||||
|
|
@ -26,7 +27,11 @@ module.exports = (env, argv) => {
|
|||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ['style-loader', 'css-loader', 'postcss-loader'],
|
||||
use: [
|
||||
isProduction ? MiniCssExtractPlugin.loader : 'style-loader',
|
||||
'css-loader',
|
||||
'postcss-loader',
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -34,6 +39,7 @@ module.exports = (env, argv) => {
|
|||
new HtmlWebpackPlugin({
|
||||
template: './src/index.html',
|
||||
}),
|
||||
...(isProduction ? [new MiniCssExtractPlugin()] : []),
|
||||
],
|
||||
devServer: {
|
||||
port: 3000,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue