Skip to content

Commit 062fdae

Browse files
committed
feat(templates): add source-map-loader loader to debug third-party libraries ✨
1 parent 85b6a72 commit 062fdae

File tree

5 files changed

+13
-1
lines changed

5 files changed

+13
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"scripts": {
3636
"prepare": "husky install",
37-
"lint": "eslint . --config=.eslintrc.cjs --ext .js,.cjs,.mjs --fix --quiet --cache --cache-location=node_modules/.cache/.eslintcache --format=pretty",
37+
"lint": "eslint . --no-eslintrc --config=.eslintrc.cjs --ext .js,.cjs,.mjs --fix --quiet --cache --cache-location=node_modules/.cache/.eslintcache --format=pretty",
3838
"commit": "cz",
3939
"release": "standard-version"
4040
},

templates/app/config/webpack.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ module.exports = ({
114114
},
115115
module: {
116116
rules: [
117+
{
118+
test: /\.js$/,
119+
enforce: 'pre',
120+
use: ['source-map-loader'],
121+
},
117122
{
118123
test: /\.([tj]s|mjs)$/i,
119124
exclude: (path) => {

templates/app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"prettier": "2.6.2",
6565
"sass": "^1.51.0",
6666
"sass-loader": "^12.6.0",
67+
"source-map-loader": "^3.0.1",
6768
"style-loader": "^3.3.1",
6869
"stylelint": "^14.8.1",
6970
"stylelint-color-format": "^1.1.0",

templates/react-app/config/webpack.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ module.exports = ({
116116
},
117117
module: {
118118
rules: [
119+
{
120+
test: /\.js$/,
121+
enforce: 'pre',
122+
use: ['source-map-loader'],
123+
},
119124
{
120125
test: /\.([tj]sx?|mjs)$/i,
121126
exclude: (path) => {

templates/react-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"redux-logger": "^3.0.6",
7878
"sass": "^1.51.0",
7979
"sass-loader": "^12.6.0",
80+
"source-map-loader": "^3.0.1",
8081
"style-loader": "^3.3.1",
8182
"stylelint": "^14.8.1",
8283
"stylelint-color-format": "^1.1.0",

0 commit comments

Comments
 (0)