1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/webpack.dll.ts
Roman d0d88e5ba7 prod-build fix
Signed-off-by: Roman <ixrock@gmail.com>
2020-08-13 20:44:53 +03:00

35 lines
802 B
TypeScript
Executable File

import path from "path";
import webpack, { LibraryTarget } from "webpack";
import { isDevelopment, buildDir } from "./src/common/vars";
export const library = "dll"
export const libraryTarget: LibraryTarget = "commonjs2"
export const manifestPath = path.resolve(buildDir, `${library}.manifest.json`);
export const packages = [
"react", "react-dom",
"ace-builds", "xterm",
"moment",
];
export default function (): webpack.Configuration {
return {
context: path.dirname(manifestPath),
mode: isDevelopment ? "development" : "production",
cache: isDevelopment,
entry: {
[library]: packages,
},
output: {
library,
libraryTarget,
},
plugins: [
new webpack.DllPlugin({
name: library,
path: manifestPath,
})
],
}
}