-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.sass.js
74 lines (73 loc) · 2.98 KB
/
webpack.sass.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
const path = require("path");
const TerserPlugin = require("terser-webpack-plugin");
module.exports = (env, argv) => {
// Return the configuration
return {
entry: [
"./node_modules/tippy.js/dist/backdrop.css",
"./node_modules/tippy.js/dist/border.css",
"./node_modules/tippy.js/dist/svg-arrow.css",
"./node_modules/tippy.js/dist/tippy.css",
"./node_modules/tippy.js/animations/perspective.css",
"./node_modules/tippy.js/animations/perspective-extreme.css",
"./node_modules/tippy.js/animations/perspective-subtle.css",
"./node_modules/tippy.js/animations/scale.css",
"./node_modules/tippy.js/animations/scale-extreme.css",
"./node_modules/tippy.js/animations/scale-subtle.css",
"./node_modules/tippy.js/animations/shift-away.css",
"./node_modules/tippy.js/animations/shift-away-extreme.css",
"./node_modules/tippy.js/animations/shift-away-subtle.css",
"./node_modules/tippy.js/animations/shift-toward.css",
"./node_modules/tippy.js/animations/shift-toward-extreme.css",
"./node_modules/tippy.js/animations/shift-toward-subtle.css",
"./node_modules/tippy.js/themes/light-border.css",
"./node_modules/tippy.js/themes/light.css",
"./node_modules/tippy.js/themes/material.css",
"./node_modules/tippy.js/themes/translucent.css",
"./src/bs.scss"
],
output: {
path: path.resolve(__dirname, "build"),
filename: "bs.js"
},
target: ["web", "es5"],
resolve: {
extensions: [".css", ".scss"]
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin()]
},
module: {
rules: [{
test: /\.(s?css)$/,
use: [
// Inject CSS to the page
{ loader: "style-loader" },
// Translate CSS to CommonJS
{ loader: "css-loader" },
// Run postcss actions
{
loader: 'postcss-loader',
options: {
// `postcssOptions` is needed for postcss 8.x;
// if you use postcss 7.x skip the key
postcssOptions: {
// postcss plugins, can be exported to postcss.config.js
plugins: () => {
return [
require('autoprefixer')
];
}
}
}
},
// Compile SASS to CSS
{
loader: "sass-loader"
}
]
}]
}
};
}