-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
69 lines (68 loc) · 1.74 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
62
63
64
65
66
67
68
69
const path = require('path');
//const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
// Chosen mode tells webpack to use its built-in optimizations accordingly.
mode: "development", // "production" | "development" | "none"
// webpack folder’s entry js — excluded from jekll’s build process.
// Multiple entry
entry:'./webpack/index.js', /*{
index: './webpack/index.js',
navbar: './webpack/components/Navbar.js'
},*/
// HtmlWebpackPlugin will generate an index.html useful to publish the website on
// Github Pages
/*plugins: [
new HtmlWebpackPlugin({
title: 'Carmine Sacco - Portfolio'
})
],*/
// we’re going to put the generated file in the assets folder so
// jekyll will grab it.
output: {
path: path.resolve(__dirname, 'assets/js'),
filename: "index.js"
},
/*optimization: {
splitChunks: {
chunks: 'all'
}
},*/
module: {
// Define loaders which are used to generate the output file from source files
rules: [
{
// Regex to detect css files
test: /\.css$/,
// Define the loaders' chain used to process the files
use:[
'style-loader',
'css-loader'
],
},
/*{
// Regex to detect scss files
test: /\.scss$/,
// Define the loaders' chain used to process the files
use:[
'style-loader',
'css-loader',
'sass-loader'
],
},*/
{
// Regex to detect images and pdf files
test: /\.(png|svg|jpg|gif|pdf)$/,
use: [
'file-loader',
]
},
{
test: /\.js?$/,
exclude: /(node_modules)/,
use:[
'babel-loader'
]
}
]
}
}