forked from standardnotes/plus-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
60 lines (59 loc) · 1.54 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
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const MergeIntoSingleFilePlugin = require("webpack-merge-and-include-globally");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: [
path.resolve(__dirname, "src", "main.js"),
path.resolve(__dirname, "src", "main.scss"),
],
output: {
path: path.join(__dirname, "dist"),
filename: "dist.js"
},
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
{
loader: "sass-loader",
options: {
sassOptions: {
includePaths: [
"src/main.scss"
],
},
},
},
],
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: "dist.css"
}),
new MergeIntoSingleFilePlugin({
files: {
"vendor.js": [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/summernote/dist/summernote.min.js',
'node_modules/@standardnotes/component-relay/dist/dist.js',
'node_modules/xss/dist/xss.js'
],
"vendor.css": [
'node_modules/bootstrap/dist/css/bootstrap.min.css',
'node_modules/summernote/dist/summernote.min.css'
]
}
}),
new HtmlWebpackPlugin({
title: "Plus Editor",
template: "editor.index.ejs"
})
],
};