-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig-overrides.js
More file actions
executable file
·29 lines (24 loc) · 886 Bytes
/
config-overrides.js
File metadata and controls
executable file
·29 lines (24 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const path = require("path");
const dependencies = Object.keys(require("./package.json").dependencies);
const libraryName = path.basename(process.env.npm_package_name);
const entryFile = "src/index.ts";
const outputFile = `${path.basename(process.env.npm_package_main)}`;
const outputDir = "build";
module.exports = {
webpack: function override(config, env) {
config.entry = { [libraryName]: path.resolve(entryFile) };
config.output.library = libraryName;
config.output.libraryTarget = "umd";
config.output.filename = outputFile;
config.output.path = path.resolve(__dirname, outputDir);
config.optimization = {};
config.externals = dependencies;
config.plugins = [
new MiniCssExtractPlugin({
filename: "static/css/styles.css"
})
];
return config;
}
};