Browse Source

added sourcemap generation

sanex3339 9 years ago
parent
commit
2dbaf3ea4f
4 changed files with 14 additions and 2 deletions
  1. 1 0
      dist/index.js
  2. 1 0
      package.json
  3. 1 1
      tsconfig.json
  4. 11 1
      webpack.config.js

+ 1 - 0
dist/index.js

@@ -1,3 +1,4 @@
+require("source-map-support").install();
 module.exports =
 /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache

+ 1 - 0
package.json

@@ -24,6 +24,7 @@
     "babel-polyfill": "^6.9.1",
     "babel-preset-es2015": "^6.9.0",
     "lite-server": "^1.3.1",
+    "source-map-support": "^0.4.0",
     "ts-loader": "^0.8.2",
     "typings": "^0.8.1",
     "webpack": "^2.1.0-beta.12",

+ 1 - 1
tsconfig.json

@@ -2,7 +2,7 @@
   "compilerOptions": {
     "target": "ES6",
     "module": "commonjs",
-    "sourceMap": false,
+    "sourceMap": true,
     "emitDecoratorMetadata": true,
     "experimentalDecorators": true,
     "removeComments": true,

+ 11 - 1
webpack.config.js

@@ -1,4 +1,5 @@
-var nodeExternals = require('webpack-node-externals');
+var nodeExternals = require('webpack-node-externals'),
+    webpack = require('webpack');
 
 module.exports = {
     entry: {
@@ -16,6 +17,15 @@ module.exports = {
         extensions: ['', '.ts'],
         modulesDirectories: ['./src', './node_modules']
     },
+    plugins: [
+        new webpack.BannerPlugin(
+            {
+                banner: 'require("source-map-support").install();',
+                raw: true,
+                entryOnly: false
+            }
+        )
+    ],
     output: {
         path: './dist',
         filename: '[name].js',