You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCAD/config/webpack.dll.ts

57 lines
1.6 KiB

import * as webpack from 'webpack';
import * as path from 'path';
import { CleanWebpackPlugin } from "clean-webpack-plugin";
import { outputDir } from './outputPath';
const dllName = "dll";
const vendors = [
"@blueprintjs/core",
"@blueprintjs/icons",
"mobx",
"mobx-react",
"react",
"react-color",
"react-dom",
"stats.js",
"xaop",
"react-rnd2",
"dxf-parser",
"pako",
"monotone-convex-hull-2d",
//如果你想调试threejs的代码,那么你应该注释掉下面的代码,然后重新构建dll
"three",
"three/examples/jsm/loaders/FBXLoader",
"three/examples/jsm/postprocessing/EffectComposer",
"three/examples/jsm/postprocessing/Pass",
"three/examples/jsm/shaders/CopyShader",
"three/examples/jsm/postprocessing/RenderPass",
"three/examples/jsm/postprocessing/SMAAPass",
"three/examples/jsm/renderers/SVGRenderer.js",
"three/examples/jsm/helpers/RectAreaLightHelper",
"three/examples/jsm//lines/LineMaterial.js",
"three/examples/jsm/lines/LineGeometry.js",
"three/examples/jsm/lines/Line2.js",
];
const config: webpack.Configuration = {
mode: "production",
output: {
path: path.resolve(__dirname, outputDir),
filename: "[hash].dll.js",
library: dllName,
},
entry: { "lib": vendors, },
plugins: [
new webpack.DllPlugin({
path: path.resolve(__dirname, `${outputDir}manifest.json`),
name: dllName,
context: __dirname,
}),
new CleanWebpackPlugin({
cleanOnceBeforeBuildPatterns: ["*.dll.js"]
}),
],
};
export default config;