代码拉取完成,页面将自动刷新
同步操作将从 yyli/dc-sdk 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* @Author: Caven
* @Date: 2020-01-18 18:22:23
* @Last Modified by: Caven
* @Last Modified time: 2020-03-17 20:56:18
*/
const path = require('path')
const webpack = require('webpack')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
function resolve(dir) {
return path.join(__dirname, '.', dir)
}
module.exports = env => {
const IS_PROD = (env && env.production) || false
const publicPath = IS_PROD ? '/' : '/'
let plugins = [
new MiniCssExtractPlugin({
filename: IS_PROD ? '[name].min.css' : '[name].css',
allChunks: true
})
]
if (IS_PROD) {
plugins.push(new OptimizeCssAssetsPlugin())
plugins.push(new webpack.NoEmitOnErrorsPlugin())
}
return {
entry: {
'dc.plugins': ['entry']
},
devtool: IS_PROD ? false : 'cheap-module-eval-source-map',
output: {
filename: IS_PROD ? '[name].min.js' : '[name].js',
path: path.resolve(__dirname, 'dist/dc-sdk/plugins'),
publicPath: publicPath,
sourcePrefix: ''
},
amd: {
toUrlUndefinded: true
},
node: {
fs: 'empty'
},
module: {
unknownContextCritical: false,
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['@babel/preset-env'],
compact: false,
ignore: ['checkTree']
}
},
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader'
},
{
loader: 'sass-loader'
}
]
},
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader'
},
{
loader: 'sass-loader'
}
]
},
{
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
loader: 'url-loader',
options: {
limit: 20000
}
},
{
test: /\.glsl$/,
loader: 'webpack-glsl-loader'
}
]
},
optimization: {
minimize: IS_PROD,
minimizer: [
new UglifyJsPlugin({
uglifyOptions: {
output: {
comments: false
},
compress: {
drop_debugger: true,
drop_console: true
}
}
})
]
},
resolve: {
extensions: ['.js', '.json', '.css'],
alias: {
'@': resolve('src'),
entry: './src/plugins/DC.Pulgins.js',
heatmap: path.resolve(__dirname, './libs/heatmap/heatmap.min.js')
}
},
plugins
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。