element/build/cooking.test.js

28 lines
774 B
JavaScript
Raw Normal View History

2016-10-11 19:00:37 +08:00
var cooking = require('cooking');
var config = require('./config');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
2016-10-20 08:50:40 +08:00
var jsLoader = process.env.CI_ENV ? 'isparta-loader' : 'isparta-loader!eslint-loader';
2016-10-11 19:00:37 +08:00
cooking.set({
entry: './src/index.js',
2016-10-20 08:50:40 +08:00
extends: process.env.CI_ENV ? ['vue2'] : ['vue2', 'lint'],
2016-10-11 19:00:37 +08:00
minimize: false,
alias: config.alias,
postcss: config.postcss,
sourceMap: '#inline-source-map'
});
2016-10-20 08:50:40 +08:00
cooking.add('vue.loaders.js', jsLoader);
2016-10-11 19:00:37 +08:00
cooking.add('loader.js.exclude', config.jsexclude);
2016-10-20 08:50:40 +08:00
cooking.add('preLoader.0', {
2016-10-11 19:00:37 +08:00
test: /\.js$/,
2016-10-20 08:50:40 +08:00
loader: 'isparta',
exclude: config.jsexclude,
include: /src|packages/
2016-10-11 19:00:37 +08:00
});
2016-10-20 08:50:40 +08:00
if (!process.env.CI_ENV) {
cooking.add('plugins.process', new ProgressBarPlugin());
}
2016-10-11 19:00:37 +08:00
module.exports = cooking.resolve();