Skip to content

Commit

Permalink
Feature/using webpack cli (#62)
Browse files Browse the repository at this point in the history
Solving

#61 node version,
#57 Other configure types not available,
#50 Add custom arguments to webpack command

Commits:
* using yarn
* packages are updated
* upgrading version to 4.0.0
* refactored back to use webpack-cli
* using yarn run instead of npm run
* documentation is updated
* fixing webpack compiler to get  webpack compilation result properly
  • Loading branch information
jkanczler authored Jan 27, 2018
1 parent 0d44b7b commit 1222c32
Show file tree
Hide file tree
Showing 45 changed files with 13,806 additions and 372 deletions.
18 changes: 10 additions & 8 deletions DETAILS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Source code can be found on [GitHub](https://github.com/Dealogic/webpack-vsts-ex

## <a id="what-the-build-step-does"></a>What The Build Step Does

This build step is using the webpack's node.js API to compile a 'web' application into a bundle. The result, warnings and errors are reported onto the build summary section.
This build step is using the webpack's command line tool to compile a 'web' application into a bundle. The result, warnings and errors are reported onto the build summary section.

## <a id="usage"></a>Usage

Expand All @@ -40,10 +40,10 @@ Add the task to your build configuration:

By default without any configuration the build task is trying to run the locally installed webpack.js from the root folder in the repository and trying to pick up the `webpack.config.js`.

Through the `webpack config location` setting the webpack config can be modified:
Through the `webpack cli arguments` setting custom arguments can be passed to the webpack cli:

```
./webpack.dist.config.js
-p --display normal
```

Errors and Warnings can be treated differently:
Expand All @@ -65,7 +65,8 @@ The webpack build result section is added onto the summary page to summarize the
### <a id="advanced-settings"></a>Advanced Settings

- Working folder where webpack command is run. If you leave it blank it is the root of the repo.
- Location of the webpack module. If you leave it blank it is using the locally installed webpack node module in the working folder, e.g. `./node_modules/webpack`.
- Location of the webpack cli. By default it is the locally installed webpack node module in the working folder, e.g. `./node_modules/webpack/bin/webpack.js`.
- Location of the Stats.js. By default it is the locally installed webpack node module in the working folder, e.g. `./node_modules/webpack/lib/Stats.js`.

![Advanced settings](https://raw.githubusercontent.com/Dealogic/webpack-vsts-extension/master/screenshots/AdvancedSettings.png)

Expand All @@ -92,16 +93,17 @@ The result sections in case of multiple build steps:

Name | Required | Default Value | Description
--- | :---: | --- | ---
webpack config location | true | ./webpack.config.js | The location of the configuration for the webpack compilation. Relative to the working folder.
webpack cli arguments | false | | Arguments to pass to the webpack cli.
treat errors as | true | errors | How to treat errors. Options are: errors (breaks build) / warnings (marks build as partially succeeded) / info (reports errors as info).
treat warnings as | true | warnings | How to treat warnings. Options are: errors (breaks build) / warnings (marks build partially succeeded) / info (reports warnings as info).
workingFolder | false | | Working folder where webpack compilation is run. If you leave it blank it is the root of the repository.
webpack module location | false | | Location of the webpack module. If you leave it blank it is the locally installed 'webpack' module.
ts-node module location | false | | Location of the ts-node module. If you leave it blank it is the locally installed 'ts-node' module.
ts-node options location | false | | Location of the ts-node options. If you leave it blank the ts-node default options will be used.
webpack cli location | true | ./node_modules/webpack/bin/webpack.js | Location of the webpack cli. By default it's the locally installed webpack cli.
stats.js Location | true | ./node_modules/webpack/lib/Stats.js | Location of the Stats.js. By default it's the Stats.js from the locally installed webpack.

## <a id="release-notes"></a>Release Notes

* 4.0.0 (26/01/2018)
* Using webpack-cli again instead of node.js API.
* 3.2.2 (03/10/2017)
* Avoid webpack task summary section overflow with adding scrollbar.
* Webpack task summary section uses same font as other sections.
Expand Down
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
next-version: 3.2.2
next-version: 4.0.0
assembly-informational-format: '{SemVer}'
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Source code can be found on [GitHub](https://github.com/Dealogic/webpack-vsts-ex

## <a id="what-the-build-step-does"></a>What The Build Step Does

This build step is using the webpack's node.js API to compile a 'web' application into a bundle. The result, warnings and errors are reported onto the build summary section.
This build step is using the webpack's command line tool to compile a 'web' application into a bundle. The result, warnings and errors are reported onto the build summary section.

## <a id="usage"></a>Usage

Expand All @@ -40,10 +40,10 @@ Add the task to your build configuration:

By default without any configuration the build task is trying to run the locally installed webpack.js from the root folder in the repository and trying to pick up the `webpack.config.js`.

Through the `webpack config location` setting the webpack config can be modified:
Through the `webpack cli arguments` setting custom arguments can be passed to the webpack cli:

```
./webpack.dist.config.js
-p --display normal
```

Errors and Warnings can be treated differently:
Expand All @@ -65,7 +65,8 @@ The webpack build result section is added onto the summary page to summarize the
### <a id="advanced-settings"></a>Advanced Settings

- Working folder where webpack command is run. If you leave it blank it is the root of the repo.
- Location of the webpack module. If you leave it blank it is using the locally installed webpack node module in the working folder, e.g. `./node_modules/webpack`.
- Location of the webpack cli. By default it is the locally installed webpack node module in the working folder, e.g. `./node_modules/webpack/bin/webpack.js`.
- Location of the Stats.js. By default it is the locally installed webpack node module in the working folder, e.g. `./node_modules/webpack/lib/Stats.js`.

![Advanced settings](https://raw.githubusercontent.com/Dealogic/webpack-vsts-extension/master/screenshots/AdvancedSettings.png)

Expand All @@ -92,16 +93,17 @@ The result sections in case of multiple build steps:

Name | Required | Default Value | Description
--- | :---: | --- | ---
webpack config location | true | ./webpack.config.js | The location of the configuration for the webpack compilation. Relative to the working folder.
webpack cli arguments | false | | Arguments to pass to the webpack cli.
treat errors as | true | errors | How to treat errors. Options are: errors (breaks build) / warnings (marks build as partially succeeded) / info (reports errors as info).
treat warnings as | true | warnings | How to treat warnings. Options are: errors (breaks build) / warnings (marks build partially succeeded) / info (reports warnings as info).
workingFolder | false | | Working folder where webpack compilation is run. If you leave it blank it is the root of the repository.
webpack module location | false | | Location of the webpack module. If you leave it blank it is the locally installed 'webpack' module.
ts-node module location | false | | Location of the ts-node module. If you leave it blank it is the locally installed 'ts-node' module.
ts-node options location | false | | Location of the ts-node options. If you leave it blank the ts-node default options will be used.
webpack cli location | true | ./node_modules/webpack/bin/webpack.js | Location of the webpack cli. By default it's the locally installed webpack cli.
stats.js Location | true | ./node_modules/webpack/lib/Stats.js | Location of the Stats.js. By default it's the Stats.js from the locally installed webpack.

## <a id="release-notes"></a>Release Notes

* 4.0.0 (26/01/2018)
* Using webpack-cli again instead of node.js API.
* 3.2.2 (03/10/2017)
* Avoid webpack task summary section overflow with adding scrollbar.
* Webpack task summary section uses same font as other sections.
Expand Down
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
{
"name": "wepback-vsts-extension",
"version": "3.2.2",
"version": "4.0.0",
"description": "webpack Visual Studio Team System (VSTS) Extension",
"main": "index.js",
"scripts": {
"setup-sample-one": "cd samples/multiple-webpack-build-steps/webpack-project-one && npm install",
"setup-sample-two": "cd samples/multiple-webpack-build-steps/webpack-project-two && npm install",
"setup-sample-webpack2": "cd samples/webpack-2 && npm install",
"setup-sample-webpack3": "cd samples/webpack-3 && npm install",
"setup-sample-webpack3-with-issues": "cd samples/webpack-3-with-issues && npm install",
"setup-sample-webpack-ts-config": "cd samples/webpack-ts-config && npm install",
"setup-samples": "npm run setup-sample-one && npm run setup-sample-two && npm run setup-sample-webpack2 && npm run setup-sample-webpack3 && npm run setup-sample-webpack3-with-issues && npm run setup-sample-webpack-ts-config",
"setup": "npm run setup-samples && npm install && cd tasks/webpack-build-task && npm install",
"setup-sample-one": "cd samples/multiple-webpack-build-steps/webpack-project-one && yarn",
"setup-sample-two": "cd samples/multiple-webpack-build-steps/webpack-project-two && yarn",
"setup-sample-webpack2": "cd samples/webpack-2 && yarn",
"setup-sample-webpack3": "cd samples/webpack-3 && yarn",
"setup-sample-webpack3-with-issues": "cd samples/webpack-3-with-issues && yarn",
"setup-sample-webpack-ts-config": "cd samples/webpack-ts-config && yarn",
"setup-samples": "yarn run setup-sample-one && yarn run setup-sample-two && yarn run setup-sample-webpack2 && yarn run setup-sample-webpack3 && yarn run setup-sample-webpack3-with-issues && yarn run setup-sample-webpack-ts-config",
"setup": "yarn run setup-samples && yarn && cd tasks/webpack-build-task && yarn",
"tslint": "tslint tasks/webpack-build-task/**/*.ts -e tasks/webpack-build-task/node_modules/**/*",
"build-without-setup": "tsc && npm run tslint",
"build": "npm run setup && npm run build-without-setup",
"build-without-setup": "tsc && yarn run tslint",
"build": "yarn run setup && yarn run build-without-setup",
"update-version": "node updateVersion.js",
"update-version-without-setup": "npm run build-without-setup && npm run update-version",
"release": "npm run build && npm run update-version && node node_modules/tfx-cli/_build/tfx-cli.js extension create --manifest-glob vss-extension.json --output-path ./dist",
"update-version-without-setup": "yarn run build-without-setup && yarn run update-version",
"release": "yarn run build && yarn run update-version && node node_modules/tfx-cli/_build/tfx-cli.js extension create --manifest-glob vss-extension.json --output-path ./dist",
"test-reporter": "cd tasks/webpack-build-task && mocha tests/suite.js --reporter mocha-junit-reporter --reporter-options mochaFile=./test-results.xml",
"test": "npm run build-without-setup && cd tasks/webpack-build-task && mocha tests/suite.js"
"test": "yarn run build-without-setup && cd tasks/webpack-build-task && mocha tests/suite.js"
},
"author": "Dealogic",
"license": "MIT",
"dependencies": {},
"devDependencies": {
"@types/chai": "4.0.1",
"@types/mocha": "2.2.41",
"@types/node": "8.0.6",
"chai": "4.0.2",
"mocha": "3.4.2",
"mocha-junit-reporter": "1.13.0",
"tfx-cli": "0.4.9",
"tslint": "5.4.3",
"typescript": "2.4.1"
"@types/chai": "4.0.10",
"@types/mocha": "2.2.45",
"@types/node": "8.5.2",
"chai": "4.1.2",
"mocha": "4.0.1",
"mocha-junit-reporter": "1.15.0",
"tfx-cli": "0.5.2",
"tslint": "5.8.0",
"typescript": "2.6.2"
}
}
Loading

0 comments on commit 1222c32

Please sign in to comment.