naive-ui/build/webpack.dev.js

57 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-06-28 15:58:33 +08:00
/**
* Webpack config under development
*/
2019-05-29 17:49:01 +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')
2020-06-26 02:16:17 +08:00
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin')
2019-05-29 17:49:01 +08:00
const webpackConfig = {
mode: 'development',
2020-08-04 21:45:05 +08:00
entry: './demo/dev-index',
2019-05-29 17:49:01 +08:00
output: {
2019-06-04 11:30:56 +08:00
path: path.resolve(process.cwd()),
2019-10-14 13:10:26 +08:00
publicPath: '/',
2019-05-29 17:49:01 +08:00
filename: '[name].[hash:7].js',
chunkFilename: '[name].[hash:7].js'
},
resolve: config.resolve,
2019-05-29 17:49:01 +08:00
devServer: {
host: '0.0.0.0',
2020-09-09 16:49:06 +08:00
port: 14138,
2019-05-29 17:49:01 +08:00
publicPath: '/',
2019-10-14 13:10:26 +08:00
hot: true,
historyApiFallback: true
2019-05-29 17:49:01 +08:00
},
performance: {
hints: false
},
stats: {
children: false
},
module: {
2020-03-20 22:52:54 +08:00
rules: config.docLoaders()
2019-05-29 17:49:01 +08:00
},
plugins: [
2020-06-26 02:16:17 +08:00
new CaseSensitivePathsPlugin(),
2019-05-29 17:49:01 +08:00
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: './demo/index.tpl',
2019-10-28 12:39:56 +08:00
favicon: './demo/assets/images/naivelogo.svg'
2019-05-29 17:49:01 +08:00
}),
new VueLoaderPlugin(),
new webpack.LoaderOptionsPlugin({
vue: {
compilerOptions: {
preserveWhitespace: false
}
}
2020-09-17 01:02:59 +08:00
}),
...config.plugins
2019-05-29 17:49:01 +08:00
]
}
2019-06-04 11:30:56 +08:00
module.exports = webpackConfig