2019-06-28 15:58:33 +08:00
|
|
|
/**
|
|
|
|
* Webpack config to see if css file works on demo page
|
|
|
|
*/
|
2019-05-24 20:09:35 +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')
|
2020-03-04 03:01:15 +08:00
|
|
|
const env = process.env.NODE_ENV
|
2019-05-24 20:09:35 +08:00
|
|
|
|
|
|
|
const webpackConfig = {
|
2020-03-04 03:01:15 +08:00
|
|
|
mode: env === 'production' ? 'production' : 'development',
|
2020-02-13 22:22:04 +08:00
|
|
|
entry: './demo/deploymentIndex.js',
|
2019-05-24 20:09:35 +08:00
|
|
|
output: {
|
2019-06-04 11:30:56 +08:00
|
|
|
path: path.resolve(process.cwd()),
|
2020-02-11 20:24:56 +08:00
|
|
|
publicPath: '/',
|
2019-05-24 20:09:35 +08:00
|
|
|
filename: '[name].[hash:7].js',
|
|
|
|
chunkFilename: '[name].[hash:7].js'
|
|
|
|
},
|
|
|
|
resolve: {
|
2020-02-11 20:24:56 +08:00
|
|
|
extensions: ['.js', '.vue', '.json', '.entry'],
|
2019-05-24 20:09:35 +08:00
|
|
|
alias: config.alias,
|
|
|
|
modules: ['node_modules']
|
|
|
|
},
|
|
|
|
devServer: {
|
|
|
|
host: '0.0.0.0',
|
2020-02-11 20:24:56 +08:00
|
|
|
port: 8087,
|
2019-05-24 20:09:35 +08:00
|
|
|
publicPath: '/',
|
|
|
|
hot: true
|
|
|
|
},
|
|
|
|
performance: {
|
|
|
|
hints: false
|
|
|
|
},
|
|
|
|
stats: {
|
|
|
|
children: false
|
|
|
|
},
|
|
|
|
module: {
|
2020-02-11 20:24:56 +08:00
|
|
|
rules: config.docLoaders
|
2019-05-24 20:09:35 +08:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: './demo/index.tpl',
|
2020-02-11 20:24:56 +08:00
|
|
|
favicon: './demo/assets/images/naivelogo.svg'
|
2019-05-24 20:09:35 +08:00
|
|
|
}),
|
|
|
|
new VueLoaderPlugin(),
|
|
|
|
new webpack.LoaderOptionsPlugin({
|
|
|
|
vue: {
|
|
|
|
compilerOptions: {
|
|
|
|
preserveWhitespace: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-06-04 11:30:56 +08:00
|
|
|
module.exports = webpackConfig
|