代码拉取完成,页面将自动刷新
同步操作将从 youngoldman/react-design-editor 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const webpack = require('webpack');
const path = require('path');
const merge = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin');
const baseConfig = require('./webpack.common.js');
const pathsToClean = [
'js',
];
const cleanOptions = {
root: path.resolve(__dirname, 'public'),
verbose: true,
};
const plugins = [
// 로더들에게 옵션을 넣어주는 플러그인
new webpack.LoaderOptionsPlugin({
minimize: true,
}),
// index.html 로 의존성 파일들 inject해주는 플러그인
new HtmlWebpackPlugin({
filename: 'index.html',
title: 'React Design Editor',
meta: {
description: `React Design Editor has started to developed direct manipulation of editable design tools like Powerpoint, We've developed it with react.js, ant.design, fabric.js`,
},
}),
new WorkboxPlugin.InjectManifest({
swSrc: './src/sw.js',
swDest: 'sw.js',
}),
new CleanWebpackPlugin(pathsToClean, cleanOptions),
];
module.exports = merge(baseConfig, {
mode: 'production',
entry: {
vendor: [
'react',
'react-dom',
'lodash',
'fabric',
'antd',
],
app: ['@babel/polyfill', path.resolve(__dirname, 'src/index.js')],
},
output: {
// entry에 존재하는 app.js, vendor.js로 뽑혀 나온다.
path: path.resolve(__dirname, 'public'),
filename: 'js/[name].[chunkhash:16].js',
chunkFilename: 'js/[id].[chunkhash:16].js',
publicPath: './',
},
optimization: {
minimizer: [
// we specify a custom UglifyJsPlugin here to get source maps in production
new TerserPlugin({
cache: true,
parallel: true,
terserOptions: {
warnings: false,
compress: {
warnings: false,
unused: true, // tree shaking(export된 모듈 중 사용하지 않는 모듈은 포함하지않음)
},
ecma: 6,
mangle: true,
unused: true,
},
sourceMap: true,
}),
],
},
plugins,
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。