代码拉取完成,页面将自动刷新
/**
* Configs file for bundling
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com>
*/
const pkg = require('./package.json');
const webpack = require('webpack');
const SafeUmdPlugin = require('safe-umd-webpack-plugin');
const uglifyJS = new webpack.optimize.UglifyJsPlugin({
compress: {
'drop_console': true,
warnings: false
},
'screw_ie8': false,
'support_ie8': true,
mangle: true,
output: {comments: false}
});
const isProduction = process.argv.indexOf('-p') > -1;
const FILENAME = pkg.name + (isProduction ? '.min.js' : '.js');
const BANNER = [
FILENAME,
`@version ${pkg.version}`,
`@author ${pkg.author}`,
`@license ${pkg.license}`
].join('\n');
const config = {
eslint: {
failOnError: isProduction
},
entry: './src/js/index.js',
output: {
library: ['tui', 'dom'],
libraryTarget: 'umd',
path: 'dist',
publicPath: 'dist',
filename: FILENAME
},
externals: {
'tui-code-snippet': {
'commonjs': 'tui-code-snippet',
'commonjs2': 'tui-code-snippet',
'amd': 'tui-code-snippet',
'root': ['tui', 'util']
}
},
module: {
preLoaders: [
{
test: /\.js$/,
exclude: /(test|node_modules|bower_components)/,
loader: 'eslint-loader'
}
],
loaders: [{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel'
}]
},
plugins: [
new SafeUmdPlugin(),
new webpack.BannerPlugin(BANNER)
],
devServer: {
historyApiFallback: false,
progress: true,
host: '0.0.0.0',
disableHostCheck: true
}
};
if (isProduction) {
config.plugins.push(uglifyJS);
}
module.exports = config;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。