Browse Source

use webpack.sourcemapdevtoolplugin for reliable sourcemaps

Eugene Pankov 6 years ago
parent
commit
5820b7ff9a

+ 4 - 1
terminus-community-color-schemes/webpack.config.js

@@ -4,7 +4,6 @@ const webpack = require('webpack')
 module.exports = {
     target: 'node',
     entry: 'src/index.ts',
-    devtool: 'source-map',
     context: __dirname,
     output: {
         path: path.resolve(__dirname, 'dist'),
@@ -51,5 +50,9 @@ module.exports = {
     ],
     plugins: [
         new webpack.optimize.ModuleConcatenationPlugin(),
+        new webpack.SourceMapDevToolPlugin({
+            exclude: [/node_modules/, /vendor/],
+            filename: '[file].map',
+        }),
     ],
 }

+ 4 - 1
terminus-core/webpack.config.js

@@ -4,7 +4,6 @@ const webpack = require('webpack')
 module.exports = {
     target: 'node',
     entry: 'src/index.ts',
-    devtool: 'source-map',
     context: __dirname,
     mode: 'development',
     output: {
@@ -61,5 +60,9 @@ module.exports = {
     ],
     plugins: [
         new webpack.optimize.ModuleConcatenationPlugin(),
+        new webpack.SourceMapDevToolPlugin({
+            exclude: [/node_modules/, /vendor/],
+            filename: '[file].map',
+        }),
     ],
 }

+ 4 - 1
terminus-plugin-manager/webpack.config.js

@@ -4,7 +4,6 @@ const webpack = require('webpack')
 module.exports = {
     target: 'node',
     entry: 'src/index.ts',
-    devtool: 'source-map',
     context: __dirname,
     output: {
         path: path.resolve(__dirname, 'dist'),
@@ -56,5 +55,9 @@ module.exports = {
     ],
     plugins: [
         new webpack.optimize.ModuleConcatenationPlugin(),
+        new webpack.SourceMapDevToolPlugin({
+            exclude: [/node_modules/, /vendor/],
+            filename: '[file].map',
+        }),
     ],
 }

+ 4 - 1
terminus-settings/webpack.config.js

@@ -4,7 +4,6 @@ const webpack = require('webpack')
 module.exports = {
     target: 'node',
     entry: 'src/index.ts',
-    devtool: 'source-map',
     context: __dirname,
     mode: 'development',
     output: {
@@ -58,5 +57,9 @@ module.exports = {
     ],
     plugins: [
         new webpack.optimize.ModuleConcatenationPlugin(),
+        new webpack.SourceMapDevToolPlugin({
+            exclude: [/node_modules/, /vendor/],
+            filename: '[file].map',
+        }),
     ],
 }

+ 9 - 2
terminus-ssh/webpack.config.js

@@ -1,9 +1,9 @@
 const path = require('path')
+const webpack = require('webpack')
 
 module.exports = {
     target: 'node',
     entry: 'src/index.ts',
-    devtool: 'source-map',
     context: __dirname,
     output: {
         path: path.resolve(__dirname, 'dist'),
@@ -54,5 +54,12 @@ module.exports = {
         /^@angular/,
         /^@ng-bootstrap/,
         /^terminus-/,
-    ]
+    ],
+    plugins: [
+        new webpack.optimize.ModuleConcatenationPlugin(),
+        new webpack.SourceMapDevToolPlugin({
+            exclude: [/node_modules/, /vendor/],
+            filename: '[file].map',
+        }),
+    ],
 }

+ 4 - 1
terminus-terminal/webpack.config.js

@@ -4,7 +4,6 @@ const webpack = require('webpack')
 module.exports = {
     target: 'node',
     entry: 'src/index.ts',
-    devtool: 'source-map',
     context: __dirname,
     output: {
         path: path.resolve(__dirname, 'dist'),
@@ -77,5 +76,9 @@ module.exports = {
     ],
     plugins: [
         new webpack.optimize.ModuleConcatenationPlugin(),
+        new webpack.SourceMapDevToolPlugin({
+            exclude: [/node_modules/, /vendor/],
+            filename: '[file].map',
+        }),
     ],
 }