Skip to content

Commit 2e418aa

Browse files
author
ludak
committed
Dev and Prod Webpack Configuration
1 parent 22bc5d2 commit 2e418aa

File tree

3 files changed

+29
-10
lines changed

3 files changed

+29
-10
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"scripts": {
1515
"build": "webpack --config webpack.config.js",
16+
"local": "webpack --config webpack.dev.config.js",
1617
"test": "ava \"**/*.test.js\"",
1718
"watchtest": "ava \"**/*.test.js\" --watch"
1819
},

webpack.config.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
const webpack = require('webpack')
21
const path = require('path')
32

43
module.exports = {
5-
mode: 'development',
4+
mode: 'production',
65
entry: {
76
index: "./src/index.js"
87
},
@@ -12,15 +11,8 @@ module.exports = {
1211
library: "orbarr"
1312
},
1413
module: {
15-
rules: [
16-
{
17-
test: /\.js$/,
18-
enforce: 'pre',
19-
use: ["source-map-loader"],
20-
}
21-
],
14+
rules: [],
2215
},
23-
devtool : 'inline-source-map',
2416
resolve: {
2517
modules: ['node_modules']
2618
},

webpack.dev.config.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const path = require('path')
2+
3+
module.exports = {
4+
mode: 'development',
5+
entry: {
6+
index: "./src/index.js"
7+
},
8+
output: {
9+
filename: "[name].js",
10+
path: path.join(__dirname, 'dist'),
11+
library: "orbarr"
12+
},
13+
module: {
14+
rules: [
15+
{
16+
test: /\.js$/,
17+
enforce: 'pre',
18+
use: ["source-map-loader"],
19+
}
20+
],
21+
},
22+
devtool : 'inline-source-map',
23+
resolve: {
24+
modules: ['node_modules']
25+
},
26+
}

0 commit comments

Comments
 (0)