naive-ui/build/webpack.doc.js

52 lines
1.2 KiB
JavaScript
Raw Normal View History

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')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const webpackConfig = {
mode: 'development',
entry: './demo/index.js',
output: {
2019-06-23 15:47:39 +08:00
path: path.resolve(__dirname, '..', 'doc', 'dist'),
2019-06-21 13:30:37 +08:00
publicPath: '',
filename: '[name].[hash:7].js',
chunkFilename: '[name].[hash:7].js'
},
resolve: {
2019-09-27 16:15:17 +08:00
extensions: ['.js', '.vue', '.json', '.entry'],
2019-06-21 13:30:37 +08:00
alias: config.alias,
modules: ['node_modules']
},
performance: {
hints: false
},
stats: {
children: false
},
module: {
2019-10-10 22:38:29 +08:00
rules: config.docLoaders
2019-06-21 13:30:37 +08:00
},
plugins: [
new HtmlWebpackPlugin({
template: './demo/index.tpl',
filename: './index.html'
}),
new VueLoaderPlugin(),
new webpack.LoaderOptionsPlugin({
vue: {
compilerOptions: {
preserveWhitespace: false
}
}
}),
2019-06-24 16:24:05 +08:00
new ExtractTextPlugin('[name].[hash:7].css')
2019-06-21 13:30:37 +08:00
]
}
module.exports = webpackConfig