madskristensen / WebPackTaskRunner

A Visual Studio extension
Other
39 stars 16 forks source link

Doesn't work with WebPack 2.2.1 #32

Closed curia-damiano closed 7 years ago

curia-damiano commented 7 years ago

Installed product versions

Description

When using the latest version of WebPack, it seems that the extension runs the webpack.config.js from two folders parent of the folder containing the script

Steps to recreate

  1. Install the latest version of WebPack
  2. Use the following webpack.config.js to bundle a TypeScript solution:

"use strict";

module.exports = { entry: "./app/main.ts", output: { filename: "./dist/bundle.js" }, devServer: { contentBase: ".", host: "localhost", port: 9000 }, //resolve: { // Add '.ts' and '.tsx' as resolvable extensions. // extensions: ["", ".webpack.js", ".web.js", ".ts", ".tsx", ".js"] //}, devtool: 'source-map', module: { rules: [ { // All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'. test: /.tsx?$/, loader: "awesome-typescript-loader", exclude: /(node_modules)/, }, { // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. enforce: 'pre', test: /.js$/, loader: "source-map-loader", exclude: /(node_modules)/, } ] } };

Current behavior

The script is run two folders up to the folder containg the js script

Expected behavior

The script should be run from the same folder containg the script (as it was happening with WebPack 1.x)

scottaddie commented 7 years ago

Which task are you running in the extension (e.g., Run/Run - Production)? Also, what do you mean by "js script" in the Current behavior section?

curia-damiano commented 7 years ago

Hi, I try a simple "Run" that should be executed in debug mode

Maci68 commented 7 years ago

we must change CLI arguments inside plugin. Probably better solution to future is add possibility to load these arguments from external file for example "webpackTaskRunner.config.json". If no found external file , defaults are used.

curia-damiano commented 7 years ago

Hi, sure this would be great and it would be an additional. For me now it would be important that the plugin works as before in the default state. Thank you, Damiano

Maci68 commented 7 years ago

you can be use https://github.com/madskristensen/NpmTaskRunner and add to package.json file this configuration. It is same functionality as WebPackTaskRunner plugin with possibility to manage CLI arguments for webpack 2.2.x. I use it two days and work correctly. "scripts": { "RUNFE_DEVELOPER": "webpack -d --devtool source-map --color", "RUN__FE_PRODUCTION": "webpack -p --color", "WATCHFE_DEVELOPER": "webpack -d --devtool source-map --watch --color" },

damienbod commented 7 years ago

If your doing angular development, you cannot use the webpack task runner because it is not possible to do AoT builds with this, use the NpmTaskRunner as suggested by @Maci68

Greetings Damien

curia-damiano commented 7 years ago

Hi, I don't know why or what has changed, but now the plugin works fine in Visual Studio. So I close the issue. Thank you for your support. Damiano