naive-ui/build/webpack.test.js

71 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-06-28 15:58:33 +08:00
/**
* Webpack config for unit test
*/
const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const config = require('./config')
2019-05-24 14:41:33 +08:00
const webpackConfig = {
mode: 'development',
entry: {
app: ['./src/index.js']
2019-05-24 14:41:33 +08:00
},
output: {
path: path.resolve(process.cwd(), './dist'),
publicPath: '/dist/',
filename: '[name].js',
chunkFilename: '[id].js'
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: config.alias,
2019-05-24 14:41:33 +08:00
modules: ['node_modules']
},
module: {
rules: [
{
test: /\.(jsx?|babel|es6)$/,
include: process.cwd(),
exclude: /node_modules|utils\/popper\.js|utils\/date\.js/,
loader: 'babel-loader'
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
compilerOptions: {
preserveWhitespace: false
}
}
},
{
2019-06-21 23:23:58 +08:00
test: /\.(scss|css)$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
]
2019-05-24 14:41:33 +08:00
},
{
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 VueLoaderPlugin()
]
2019-06-04 11:30:56 +08:00
}
2019-05-24 14:41:33 +08:00
// if (!process.env.CI_ENV) {
// webpackConfig.plugins.push(
// new ProgressBarPlugin()
// );
// }
2019-06-04 11:30:56 +08:00
module.exports = webpackConfig