-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebpack-standalone.config.js
50 lines (49 loc) · 1.21 KB
/
webpack-standalone.config.js
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* This config is used to generate a standalone javascript and
* css file that can be imported into a basic html file.
*/
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
entry: "./dist/js/index.js",
output: {
library: "AlignmentViewer2",
libraryTarget: "umd",
filename: "standalone/alignmentviewer.js",
path: path.resolve(__dirname, "dist"),
},
optimization: {
minimize: true,
},
plugins: [
new MiniCssExtractPlugin({ filename: "standalone/alignmentviewer.css" }),
],
module: {
rules: [
{
test: /\.(sa|sc|c)ss$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: "css-loader",
options: {
modules: {
//needed to remove all :global tags, but not generate unique
//css module names
getLocalIdent: (
context,
localIdentName,
localName,
options
) => {
return localName;
},
},
},
},
"sass-loader",
],
},
],
},
};