mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-15 04:42:23 +08:00
84 lines
1.8 KiB
JavaScript
84 lines
1.8 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 webpackConfig = {
|
|
mode: 'development',
|
|
entry: './demo/indexUsingCss.js',
|
|
output: {
|
|
path: path.resolve(process.cwd()),
|
|
publicPath: '',
|
|
filename: '[name].[hash:7].js',
|
|
chunkFilename: '[name].[hash:7].js'
|
|
},
|
|
resolve: {
|
|
extensions: ['.js', '.vue', '.json'],
|
|
alias: config.alias,
|
|
modules: ['node_modules']
|
|
},
|
|
devServer: {
|
|
host: '0.0.0.0',
|
|
port: 8086,
|
|
publicPath: '/',
|
|
hot: true
|
|
},
|
|
performance: {
|
|
hints: false
|
|
},
|
|
stats: {
|
|
children: false
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.vue$/,
|
|
loader: 'vue-loader',
|
|
options: {
|
|
compilerOptions: {
|
|
preserveWhitespace: false
|
|
}
|
|
}
|
|
},
|
|
{
|
|
test: /\.(js|jsx)$/,
|
|
exclude: [/node_modules/],
|
|
loader: 'babel-loader'
|
|
},
|
|
{
|
|
test: /\.(scss|css)$/,
|
|
use: ['style-loader', 'css-loader', 'sass-loader']
|
|
},
|
|
{
|
|
test: /\.(svg|otf|ttf|woff2?|eot|gif|png|jpe?g)(\?\S*)?$/,
|
|
loader: 'url-loader',
|
|
query: {
|
|
limit: 10000,
|
|
name: path.posix.join('static', '[name].[hash:7].[ext]')
|
|
}
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
new HtmlWebpackPlugin({
|
|
template: './demo/index.tpl',
|
|
filename: './index.html'
|
|
}),
|
|
new VueLoaderPlugin(),
|
|
new webpack.LoaderOptionsPlugin({
|
|
vue: {
|
|
compilerOptions: {
|
|
preserveWhitespace: false
|
|
}
|
|
}
|
|
})
|
|
]
|
|
}
|
|
|
|
module.exports = webpackConfig
|