Skip to content

Commit 30db7f5

Browse files
committed
Write bundles to disk for Visual Studio Debugger.
1 parent e3845ec commit 30db7f5

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@
9494
"url-loader": "^0.5.7",
9595
"webpack": "^1.12.14",
9696
"webpack-dev-server": "^1.14.1",
97-
"webpack-md5-hash": "^0.0.5"
97+
"webpack-md5-hash": "^0.0.5",
98+
"write-file-webpack-plugin": "^3.1.8"
9899
},
99100
"repository": {
100101
"type": "git",

webpack.config.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var helpers = require('./helpers');
1111
var CopyWebpackPlugin = require('copy-webpack-plugin');
1212
var HtmlWebpackPlugin = require('html-webpack-plugin');
1313
var ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin;
14+
var WriteFilePlugin = require('write-file-webpack-plugin');
1415

1516
/**
1617
* Webpack Constants
@@ -237,8 +238,17 @@ module.exports = {
237238
//
238239
// See: https://webpack.github.io/docs/list-of-plugins.html#defineplugin
239240
// NOTE: when adding more properties make sure you include them in custom-typings.d.ts
240-
new webpack.DefinePlugin({'ENV': JSON.stringify(METADATA.ENV), 'HMR': HMR})
241+
new webpack.DefinePlugin({'ENV': JSON.stringify(METADATA.ENV), 'HMR': HMR}),
241242

243+
// Plugin: Write File Plugin
244+
// Description: Write bundle files for debugging.
245+
// Forces webpack-dev-server program to write bundle files to the file system.
246+
//
247+
// For use in conjuction with Visual Code debugger.
248+
//
249+
// See: https://github.com/AngularClass/angular2-webpack-starter/issues/297#issuecomment-193989148
250+
// See: https://github.com/gajus/write-file-webpack-plugin
251+
new WriteFilePlugin()
242252
],
243253

244254
// Static analysis linter for TypeScript advanced options configuration
@@ -264,7 +274,8 @@ module.exports = {
264274
watchOptions: {
265275
aggregateTimeout: 300,
266276
poll: 1000
267-
}
277+
},
278+
outputPath: helpers.root('dist')
268279
},
269280

270281
// Include polyfills or mocks for various node stuff

0 commit comments

Comments
 (0)