代码拉取完成,页面将自动刷新
同步操作将从 后盾人/HDJS 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const webpack = require('webpack');
function resolve(dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: {
hdjs: './src/hdjs.js',
vendor: [
'jquery', 'bootstrap-sass', 'moment'
// , 'bootstrap-switch',
// 'jquery-caret', 'chart.js', 'clockpicker/dist/jquery-clockpicker',
// 'spectrum-colorpicker', 'js-cookie', 'bootstrap-daterangepicker',
// 'jquery-datetimepicker', 'webuploader', 'md5', 'bootstrap-notify',
// 'qrcode', 'select2', 'swiper', 'zeroclipboard', 'video.js/dist/video',
],
// modules: [
// './src/component/ueditor/ueditor.all'
// ]
},
output: {
//输出目录
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
sourceMapFilename: '[name].map',
libraryTarget: "umd",
library: "hdjs",
publicPath: '/dist/',
chunkFilename: "[chunkhash].js",
},
externals: {},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {'vue': 'vue/dist/vue.js', '@': resolve('src')}
},
//热加载使用的项目目录
devServer: {contentBase: path.join(__dirname, "dist"), port: 9000},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ["vendor"],
// minChunks: ({ resource }) => (
// resource &&
// resource.indexOf('node_modules') >= 0 &&
// resource.match(/\.js$/)
// ),
}),
//压缩代码
// new UglifyJSPlugin({output: {comments: false}}),
//清理打包目录
new CleanWebpackPlugin(['dist']),
//生成css文件
new ExtractTextPlugin("hdjs.css"),
//模板文件并生成到dist目录中,用于热加载使用
new HtmlWebpackPlugin({title: 'hdjs-vue', template: __dirname + '/src/module.html'}),
new webpack.ProvidePlugin({$: "jquery", jQuery: "jquery", "window.jQuery": "jquery"}),
new CopyWebpackPlugin([{from: 'static', to: 'static'}])
],
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {loader: 'babel-loader', options: {presets: ['env']}}
},
{
test: /\.(woff|woff2|eot|ttf|svg|jpg|png|gif)$/,
use: [{
loader: 'url-loader',
options: {limit: 10000, name: '[path][name].[ext]',}
}]
},
{
test: /\.css/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [{loader: 'css-loader', options: {minimize: true}}]
})
},
{
test: /\.less$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{loader: 'css-loader', options: {minimize: true}},
{loader: 'less-loader'}
]
})
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{loader: 'css-loader', options: {minimize: true}},
{loader: 'sass-loader'}
]
})
}
]
}
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。