mirror of https://gitee.com/cf-fz/WebCAD.git
parent
94e8092573
commit
cbd0c3cdeb
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,9 @@
|
||||
var GitRevisionPlugin = require('git-revision-webpack-plugin');
|
||||
var gitRevisionPlugin = new GitRevisionPlugin();
|
||||
export let outputDir: string;
|
||||
|
||||
const useGitBranchName = false;
|
||||
if (useGitBranchName)
|
||||
outputDir = `../dist_${gitRevisionPlugin.branch()}/`;
|
||||
else
|
||||
outputDir = "../dist/"
|
@ -0,0 +1,24 @@
|
||||
import * as webpack from 'webpack';
|
||||
import * as merge from 'webpack-merge';
|
||||
import { outputDir } from './outputPath';
|
||||
import common from './webpack.common';
|
||||
|
||||
const config: webpack.Configuration = merge(
|
||||
common,
|
||||
{
|
||||
mode: "development",
|
||||
output: { pathinfo: false },
|
||||
devtool: "cheap-module-eval-source-map",
|
||||
devServer: {
|
||||
contentBase: outputDir,
|
||||
port: 7778,
|
||||
hot: true
|
||||
},
|
||||
plugins: [
|
||||
new webpack.NamedModulesPlugin(),//Hot
|
||||
new webpack.HotModuleReplacementPlugin(),//Hot
|
||||
]
|
||||
}
|
||||
);
|
||||
|
||||
export default config;
|
@ -0,0 +1,46 @@
|
||||
import * as webpack from 'webpack';
|
||||
import * as path from 'path';
|
||||
import UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
||||
import { outputDir } from './outputPath';
|
||||
|
||||
const dllName = "dll"
|
||||
const vendors = [
|
||||
"@blueprintjs/core",
|
||||
"css-element-queries",
|
||||
"mobx",
|
||||
"mobx-react",
|
||||
"react",
|
||||
"react-addons-css-transition-group",
|
||||
"react-color",
|
||||
"react-dom",
|
||||
"stats.js",
|
||||
"xaop",
|
||||
"blueimp-md5"
|
||||
];
|
||||
|
||||
const config: webpack.Configuration = {
|
||||
mode: "production",
|
||||
output: {
|
||||
path: path.resolve(__dirname, outputDir),
|
||||
filename: dllName + '.js',
|
||||
library: dllName,
|
||||
},
|
||||
entry: { "lib": vendors, },
|
||||
plugins: [
|
||||
new webpack.DllPlugin({
|
||||
path: path.resolve(__dirname, `${outputDir}manifest.json`),
|
||||
name: dllName,
|
||||
context: __dirname,
|
||||
}),
|
||||
new UglifyJSPlugin(
|
||||
{
|
||||
sourceMap: true,
|
||||
cache: true,
|
||||
extractComments: true,
|
||||
parallel: 4
|
||||
}
|
||||
)
|
||||
],
|
||||
};
|
||||
|
||||
export default config;
|
@ -0,0 +1,41 @@
|
||||
import * as webpack from 'webpack';
|
||||
import * as merge from 'webpack-merge';
|
||||
import common from './webpack.common';
|
||||
import UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
||||
|
||||
const config: webpack.Configuration = merge(
|
||||
common,
|
||||
{
|
||||
mode: "production",
|
||||
devtool: "source-map",
|
||||
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new UglifyJSPlugin(
|
||||
{
|
||||
sourceMap: true,
|
||||
cache: true,
|
||||
extractComments: true,
|
||||
parallel: true,
|
||||
uglifyOptions: {
|
||||
output: {
|
||||
beautify: false,
|
||||
},
|
||||
// mangle: {
|
||||
// properties: {
|
||||
// // mangle property options
|
||||
// // keep_quoted: true 混淆属性
|
||||
// debug: true //因为混淆了THREE库导致的错误.
|
||||
// }
|
||||
// },
|
||||
keep_classnames: true,
|
||||
toplevel: true,
|
||||
},
|
||||
}
|
||||
)
|
||||
]
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
export default config;
|
@ -1,38 +0,0 @@
|
||||
const webpack = require('webpack');
|
||||
|
||||
const dllName = "dll"
|
||||
var path = require('path');
|
||||
const vendors = [
|
||||
"@blueprintjs/core",
|
||||
"css-element-queries",
|
||||
"mobx",
|
||||
"mobx-react",
|
||||
"react",
|
||||
"react-addons-css-transition-group",
|
||||
"react-color",
|
||||
"react-dom",
|
||||
"stats.js",
|
||||
"xaop",
|
||||
"blueimp-md5"
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
filename: dllName + '.js',
|
||||
library: dllName,
|
||||
},
|
||||
entry: {
|
||||
"lib": vendors,
|
||||
},
|
||||
resolve: {
|
||||
},
|
||||
// devtool: "source-map",
|
||||
plugins: [
|
||||
new webpack.DllPlugin({
|
||||
path: 'manifest.json',
|
||||
name: dllName,
|
||||
context: __dirname,
|
||||
})
|
||||
],
|
||||
};
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,5 +0,0 @@
|
||||
{
|
||||
"globalDependencies": {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in new issue