naive-ui/build/webpack.demo.js
2020-09-17 01:02:59 +08:00

60 lines
1.3 KiB
JavaScript

/**
* Webpack config to see if css file works on demo page
*/
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 MiniCssExtractPlugin = require('mini-css-extract-plugin')
const webpackConfig = {
mode: 'production',
entry: './demo/deployment-index.js',
output: {
path: path.resolve(process.cwd()),
publicPath: '/',
filename: '[name].[hash:7].js',
chunkFilename: '[name].[hash:7].js'
},
resolve: config.resolve,
devServer: {
host: '0.0.0.0',
port: 8087,
publicPath: '/',
hot: false,
historyApiFallback: true
},
performance: {
hints: false
},
stats: {
children: false
},
module: {
rules: config.docLoaders('production')
},
plugins: [
new HtmlWebpackPlugin({
template: './demo/index.tpl',
favicon: './demo/assets/images/naivelogo.svg'
}),
new VueLoaderPlugin(),
new webpack.LoaderOptionsPlugin({
vue: {
compilerOptions: {
preserveWhitespace: false
}
}
}),
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css',
ignoreOrder: false
}),
...config.plugins
]
}
module.exports = webpackConfig