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')
|
2019-06-04 11:30:56 +08:00
|
|
|
const VueLoaderPlugin = require('vue-loader/lib/plugin')
|
2019-05-29 17:49:01 +08:00
|
|
|
|
|
|
|
const webpackConfig = {
|
|
|
|
mode: 'development',
|
|
|
|
entry: './demo/index.js',
|
|
|
|
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: {
|
2019-09-23 19:14:15 +08:00
|
|
|
extensions: ['.js', '.vue', '.json', '.entry'],
|
2019-05-29 17:49:01 +08:00
|
|
|
alias: config.alias,
|
|
|
|
modules: ['node_modules']
|
|
|
|
},
|
|
|
|
devServer: {
|
|
|
|
host: '0.0.0.0',
|
|
|
|
port: 8086,
|
|
|
|
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: {
|
2019-10-10 22:38:29 +08:00
|
|
|
rules: config.docLoaders
|
2019-05-29 17:49:01 +08:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-06-04 11:30:56 +08:00
|
|
|
module.exports = webpackConfig
|