-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
61 lines (60 loc) · 1.27 KB
/
webpack.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
51
52
53
54
55
56
57
58
59
60
61
const Fs = require("fs");
const procfile = Fs.readFileSync("spin/spin-proc.js").toString("utf-8");
Fs.writeFileSync(
"sflist.js",
`export const sf2list=${JSON.stringify(
require("child_process")
.execSync("ls -rS static/*sf2")
.toString()
.trim()
.split("\n")
)}`
);
Fs.writeFileSync(
"mfilelist.js",
`export const mfilelist=${JSON.stringify(
require("child_process")
.execSync("ls -rS static/midi/*mid")
.toString()
.trim()
.split("\n")
.map((f) => encodeURI(f))
)}`
);
const path = require("path");
module.exports = {
mode: "production",
entry: {
sequence: "./src/sequence/index.js",
timer: "./src/sequence/timer.js",
// main: "./src/index.js",
},
module: {
rules: [
{
test: /\.?js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env", "@babel/preset-react"],
},
},
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
],
},
devtool: "inline-source-map",
devServer: {
static: ".",
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "dist"),
clean: true,
publicPath: "/",
},
};