Skip to content

Commit

Permalink
Merge pull request #92 from odecee/fix/add-angular2-router-to-vendor-…
Browse files Browse the repository at this point in the history
…scripts

Fix/add angular2 router to vendor scripts
  • Loading branch information
uglow authored Nov 25, 2016
2 parents 34002c3 + 164877b commit 867ad91
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 26 deletions.
2 changes: 1 addition & 1 deletion lib/buildTool/npm/npmResources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ documentation:
description: Creates a development-version of the documentation website and watches for changes.

- name: docs:build
tasks: ['cross-env NODE_ENV=production webpack -p --progress --config <%- paths.config.configDir + resources.documentation.configSubDir %>swanky.webpack.config.js --colors']
tasks: ['cross-env NODE_ENV=production webpack --progress --config <%- paths.config.configDir + resources.documentation.configSubDir %>swanky.webpack.config.js --colors']
description: Creates a production-version of the documentation website in the `<%- documentation.outputDir %>`.

- name: docs:build:serve
Expand Down
5 changes: 2 additions & 3 deletions lib/buildTool/webpack/sampleApp/sampleApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,14 @@ module.exports = function() {

if (sampleAppVendorScripts) {
vendorScripts = [].concat(
sampleAppVendorScripts.pre,
sampleAppVendorScripts.pre || [],
vendorScripts,
sampleAppVendorScripts.post
sampleAppVendorScripts.post || []
);
}

config.buildJS.vendorScripts = _.uniq((config.buildJS.vendorScripts || []).concat(vendorScripts));


// Add any TEST vendor scripts to the testUnit config from the selectedFrameworkConfig
let testVendorScripts = (selectedFrameworkConfig.frameworkPackages.testPackages || []).map((pkg) => pkg.name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ config.devServer = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
'Access-Control-Allow-Headers': 'accept, content-type, authorization',
'Access-Control-Allow-Credentials': true
},
outputPath: helpers.root('<%- paths.output.devDir %>')
'Access-Control-Allow-Credentials': 'true'
}
};
/* **/
18 changes: 13 additions & 5 deletions lib/buildTool/webpack/webpackResources.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
buildBrowser:
packages:
- <<: *pkg_webpack
- <<: *pkg_loader-utils
- <<: *pkg_webpack-dev-server
- <<: *pkg_extract-text-webpack-plugin

Expand Down Expand Up @@ -107,18 +108,25 @@ sampleApp:
ES6: {}
TypeScript: {}
AngularJS 1.x:
ES6: {}
TypeScript: {}
ES6:
vendorScripts: # Add these items to the vendor scripts entryPoint
post:
- angular-route
TypeScript:
vendorScripts:
post:
- angular-route
AngularJS 2.x:
TypeScript:
vendorScripts: # Add these items to the vendor scripts entryPoint
vendorScripts:
pre:
- './polyfills.browser.ts'
post: []
post:
- '@angular/router'

React (latest):
ES6:
vendorScripts: # Add these items to the vendor scripts entryPoint.
vendorScripts:
pre:
- './polyfills.js'
post:
Expand Down
5 changes: 5 additions & 0 deletions lib/core/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,11 @@ $packages:
name: webpack
version: 2.1.0-beta.25

# We only need to include this package with webpack 2.1.0-beta.25. Later betas include it already
- &pkg_loader-utils
name: loader-utils
version: 0.2.16

- &pkg_webpack-dev-server
name: webpack-dev-server
version: 2.1.0-beta.9
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"dev": "cross-env NODE_ENV=development npm run verify:watch",
"docs:_publish": "node config/docs/publish.js",
"predocs:build": "rimraf website/",
"docs:build": "cross-env NODE_ENV=production webpack -p --progress --config config/docs/swanky.webpack.config.js --colors",
"docs:build": "cross-env NODE_ENV=production webpack --progress --config config/docs/swanky.webpack.config.js --colors",
"docs:build:serve": "npm-run-all docs:build docs:serve",
"docs:dev": "cross-env NODE_ENV=development node config/docs/serve.dev.js",
"docs:postpublish": "node config/docs/postpublish.js",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/node-es6.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generator-confit:
app:
_version: e33311babea61ce43d48fbda705c261d1fc56765
_version: 79f049c89ce496892cf2385bf177fa588156332a
buildProfile: Latest
copyrightOwner: Brett Uglow
license: UNLICENSED
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/webpack-different-paths.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generator-confit:
app:
_version: e33311babea61ce43d48fbda705c261d1fc56765
_version: 79f049c89ce496892cf2385bf177fa588156332a
buildProfile: Latest
projectType: browser
repositoryType: Other
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/webpack-es6-ng1-stylus.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generator-confit:
app:
_version: e33311babea61ce43d48fbda705c261d1fc56765
_version: 79f049c89ce496892cf2385bf177fa588156332a
buildProfile: Latest
projectType: browser
repositoryType: Other
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/webpack-es6-none-css.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generator-confit:
app:
_version: e33311babea61ce43d48fbda705c261d1fc56765
_version: 79f049c89ce496892cf2385bf177fa588156332a
buildProfile: Latest
projectType: browser
repositoryType: Other
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/webpack-es6-none-sass.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generator-confit:
app:
_version: e33311babea61ce43d48fbda705c261d1fc56765
_version: 79f049c89ce496892cf2385bf177fa588156332a
buildProfile: Latest
projectType: browser
repositoryType: Other
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/webpack-es6-none-stylus.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generator-confit:
app:
_version: e33311babea61ce43d48fbda705c261d1fc56765
_version: 79f049c89ce496892cf2385bf177fa588156332a
buildProfile: Latest
projectType: browser
repositoryType: Other
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/webpack-es6-react-stylus.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generator-confit:
app:
_version: e33311babea61ce43d48fbda705c261d1fc56765
_version: 79f049c89ce496892cf2385bf177fa588156332a
buildProfile: Latest
projectType: browser
repositoryType: Other
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/webpack-ts-ng1-stylus.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generator-confit:
app:
_version: e33311babea61ce43d48fbda705c261d1fc56765
_version: 79f049c89ce496892cf2385bf177fa588156332a
buildProfile: Latest
projectType: browser
repositoryType: Other
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/webpack-ts-ng2-stylus.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generator-confit:
app:
_version: e33311babea61ce43d48fbda705c261d1fc56765
_version: 79f049c89ce496892cf2385bf177fa588156332a
buildProfile: Latest
projectType: browser
repositoryType: Other
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/webpack-ts-none-stylus.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generator-confit:
app:
_version: e33311babea61ce43d48fbda705c261d1fc56765
_version: 79f049c89ce496892cf2385bf177fa588156332a
buildProfile: Latest
projectType: browser
repositoryType: Other
Expand Down
6 changes: 3 additions & 3 deletions test/spec/unit/documentationGenerator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe('Documentation Generator', () => {
let pkg = fs.readJsonSync('package.json');

assert.equal(pkg.scripts['docs:dev'], 'cross-env NODE_ENV=development node config/docs/serve.dev.js');
assert.equal(pkg.scripts['docs:build'], 'cross-env NODE_ENV=production webpack -p --progress --config config/docs/swanky.webpack.config.js --colors');
assert.equal(pkg.scripts['docs:build'], 'cross-env NODE_ENV=production webpack --progress --config config/docs/swanky.webpack.config.js --colors');
assert.equal(pkg.scripts['docs:build:serve'], 'npm-run-all docs:build docs:serve');
assert.equal(pkg.scripts['docs:serve'], 'http-server webdocs/ -o');
assert.equal(pkg.scripts['docs:publish'], 'npm-run-all docs:prepublish docs:build docs:_publish docs:postpublish');
Expand All @@ -199,7 +199,7 @@ describe('Documentation Generator', () => {
let pkg = fs.readJsonSync('package.json');

assert.equal(pkg.scripts['docs:dev'], 'cross-env NODE_ENV=development node config/docs/serve.dev.js');
assert.equal(pkg.scripts['docs:build'], 'cross-env NODE_ENV=production webpack -p --progress --config config/docs/swanky.webpack.config.js --colors');
assert.equal(pkg.scripts['docs:build'], 'cross-env NODE_ENV=production webpack --progress --config config/docs/swanky.webpack.config.js --colors');
assert.equal(pkg.scripts['docs:build:serve'], 'npm-run-all docs:build docs:serve');
assert.equal(pkg.scripts['docs:serve'], 'http-server webdocs/ -o');
assert.equal(pkg.scripts['docs:publish'], 'npm-run-all docs:prepublish docs:build docs:_publish docs:postpublish');
Expand All @@ -226,7 +226,7 @@ describe('Documentation Generator', () => {
let pkg = fs.readJsonSync('package.json');

assert.equal(pkg.scripts['docs:dev'], 'cross-env NODE_ENV=development node config/docs/serve.dev.js');
assert.equal(pkg.scripts['docs:build'], 'cross-env NODE_ENV=production webpack -p --progress --config config/docs/swanky.webpack.config.js --colors');
assert.equal(pkg.scripts['docs:build'], 'cross-env NODE_ENV=production webpack --progress --config config/docs/swanky.webpack.config.js --colors');
assert.equal(pkg.scripts['docs:build:serve'], 'npm-run-all docs:build docs:serve');
assert.equal(pkg.scripts['docs:serve'], 'http-server webdocs/ -o');
assert.equal(pkg.scripts['docs:publish'], 'npm-run-all docs:prepublish docs:build docs:_publish docs:postpublish');
Expand Down

0 comments on commit 867ad91

Please sign in to comment.