代码拉取完成,页面将自动刷新
var path = require('path')
var webpack = require('webpack')
var ExtractTextPlugin = require('extract-text-webpack-plugin');
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
const extractCSS = new ExtractTextPlugin('css/[name].css');
module.exports = {
entry: path.resolve(__dirname, './src/index.js'),
output: {
path: path.resolve(__dirname, './dist'),
publicPath: './',
filename: 'vue-bl-mark-down-editor.js',
chunkFilename: 'js/[name].js',
library: 'MarkDownEditor',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
rules: [
{
test: /\.css$/,
use: extractCSS.extract({
fallback: "style-loader",
use: [
"css-loader",
"vue-style-loader"
]
})
// use: [
// 'vue-style-loader',
// 'css-loader'
// ],
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
extractCSS: true,
loaders: {
}
// other vue-loader options go here
}
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif)$/,
loader: 'file-loader',
options: {
limit: 10000,
publicPath: '../',
name: 'images/[name].[ext]?[hash:7]'
}
},
//{ test: /\.(woff|ttf|eot|svg)$/, loader: 'url-loader?name=font/[name].[hash:7].[ext]&publicPath=../' },
{
test: /\.(eot|ttf|woff|woff2|svg)(\?.*)?$/,
loader: 'file-loader',
options: {
limit: 10000,
publicPath: '../',
name: 'fonts/[name].[hash:7].[ext]'
}
}
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
},
extensions: ['*', '.js', '.vue', '.json']
},
devServer: {
historyApiFallback: true,
noInfo: true,
overlay: true
},
performance: {
hints: false
},
devtool: '#source-map',
plugins:[
// 分离css
extractCSS,
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
warnings: false,
drop_debugger: true,
drop_console: true
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
}),
]
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。