2019-06-28 15:58:33 +08:00
|
|
|
/**
|
|
|
|
* Webpack config to pack documentation page
|
|
|
|
*/
|
2019-06-21 13:30:37 +08:00
|
|
|
const path = require('path')
|
|
|
|
const webpack = require('webpack')
|
|
|
|
const config = require('./config')
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
|
|
const VueLoaderPlugin = require('vue-loader/lib/plugin')
|
2020-03-20 22:52:54 +08:00
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
2019-06-21 13:30:37 +08:00
|
|
|
|
|
|
|
const webpackConfig = {
|
2020-03-05 13:45:45 +08:00
|
|
|
mode: 'production',
|
2020-08-04 21:45:05 +08:00
|
|
|
entry: './demo/deployment-index.js',
|
2019-06-21 13:30:37 +08:00
|
|
|
output: {
|
2020-06-03 14:14:01 +08:00
|
|
|
path: path.resolve(__dirname, '..', 'build-doc', 'dist'),
|
2019-10-14 13:10:26 +08:00
|
|
|
publicPath: '/',
|
2019-06-21 13:30:37 +08:00
|
|
|
filename: '[name].[hash:7].js',
|
|
|
|
chunkFilename: '[name].[hash:7].js'
|
|
|
|
},
|
2020-08-19 23:30:04 +08:00
|
|
|
resolve: config.resolve,
|
2019-06-21 13:30:37 +08:00
|
|
|
performance: {
|
|
|
|
hints: false
|
|
|
|
},
|
|
|
|
stats: {
|
|
|
|
children: false
|
|
|
|
},
|
|
|
|
module: {
|
2020-03-20 22:52:54 +08:00
|
|
|
rules: config.docLoaders('production')
|
2019-06-21 13:30:37 +08:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: './demo/index.tpl',
|
2019-10-28 12:39:56 +08:00
|
|
|
favicon: './demo/assets/images/naivelogo.svg'
|
2019-06-21 13:30:37 +08:00
|
|
|
}),
|
|
|
|
new VueLoaderPlugin(),
|
|
|
|
new webpack.LoaderOptionsPlugin({
|
|
|
|
vue: {
|
|
|
|
compilerOptions: {
|
|
|
|
preserveWhitespace: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}),
|
2020-03-20 22:52:54 +08:00
|
|
|
new MiniCssExtractPlugin({
|
|
|
|
filename: '[name].css',
|
|
|
|
chunkFilename: '[id].css',
|
|
|
|
ignoreOrder: false
|
|
|
|
})
|
2019-06-21 13:30:37 +08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = webpackConfig
|