Skip to content

Commit

Permalink
add boostrap support thanks to PatrickJS#215
Browse files Browse the repository at this point in the history
  • Loading branch information
Pietro Grandi committed May 30, 2016
1 parent 591fc9a commit e83f56d
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 91 deletions.
20 changes: 20 additions & 0 deletions config/webpack.dev.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const commonConfig = require('./webpack.common.js'); // the settings that are co
* Webpack Plugins
*/
const DefinePlugin = require('webpack/lib/DefinePlugin');
const ProvidePlugin = require('webpack/lib/ProvidePlugin');

/**
* Webpack Constants
Expand Down Expand Up @@ -91,6 +92,18 @@ module.exports = webpackMerge(commonConfig, {

},

module: {

loaders: [
// if you add a loader include the resolve file extension above
{ test: /\.scss$/, loaders: ['style', 'css', 'postcss', 'sass'] },
{ test: /\.(woff2?|ttf|eot|svg)$/, loader: 'url?limit=10000' },
// Bootstrap 4
{ test: /bootstrap\/dist\/js\/umd\//, loader: 'imports?jQuery=jquery' }
]

},

plugins: [

/**
Expand All @@ -111,7 +124,14 @@ module.exports = webpackMerge(commonConfig, {
'NODE_ENV': JSON.stringify(METADATA.ENV),
'HMR': METADATA.HMR,
}
}),

new ProvidePlugin({
jQuery: 'jquery',
$: 'jquery',
jquery: 'jquery'
})

],

/**
Expand Down
167 changes: 76 additions & 91 deletions package.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,90 +6,93 @@
"homepage": "https://github.com/angularclass/angular2-webpack-starter",
"license": "MIT",
"scripts": {
"rimraf": "rimraf",
"tslint": "tslint",
"typedoc": "typedoc",
"typings": "typings",
"webpack": "webpack",
"webpack-dev-server": "webpack-dev-server",
"webdriver-manager": "webdriver-manager",
"protractor": "protractor",

"clean": "npm cache clean && npm run rimraf -- node_modules doc typings coverage dist",
"clean:dist": "npm run rimraf -- dist",
"preclean:install": "npm run clean",
"clean:install": "npm set progress=false && npm install",
"preclean:start": "npm run clean",
"clean:start": "npm start",

"watch": "npm run watch:dev",
"watch:dev": "npm run build:dev -- --watch",
"watch:dev:hmr": "npm run watch:dev -- --hot",
"watch:test": "npm run test -- --auto-watch --no-single-run",
"watch:prod": "npm run build:prod -- --watch",

"build": "npm run build:dev",
"prebuild:dev": "npm run clean:dist",
"build:dev": "webpack --config config/webpack.dev.js --progress --profile --colors --display-error-details --display-cached",
"prebuild:prod": "npm run clean:dist",
"build:prod": "webpack --config config/webpack.prod.js --progress --profile --colors --display-error-details --display-cached --bail",

"server": "npm run server:dev",
"server:dev": "webpack-dev-server --config config/webpack.dev.js --inline --progress --profile --colors --watch --display-error-details --display-cached --content-base src/",
"server:dev:hmr": "npm run server:dev -- --hot",
"server:prod": "http-server dist --cors",

"webdriver:update": "npm run webdriver-manager update",
"webdriver:start": "npm run webdriver-manager start",

"lint": "npm run tslint 'src/**/*.ts'",

"pree2e": "npm run webdriver:update -- --standalone",
"e2e": "npm run protractor",
"e2e:live": "npm run e2e -- --elementExplorer",

"pretest": "npm run lint",
"test": "karma start",

"ci": "npm test && npm run e2e",

"docs": "npm run typedoc -- --options typedoc.json --exclude '**/*.spec.ts' ./src/",

"start": "npm run server:dev",
"start:hmr": "npm run server:dev:hmr",

"postinstall": "npm run typings -- install",

"preversion": "npm test",
"version": "npm run build",
"postversion": "git push && git push --tags"

},
"rimraf": "rimraf",
"tslint": "tslint",
"typedoc": "typedoc",
"typings": "typings",
"webpack": "webpack",
"webpack-dev-server": "webpack-dev-server",
"webdriver-manager": "webdriver-manager",
"protractor": "protractor",
"clean": "npm cache clean && npm run rimraf -- node_modules doc typings coverage dist",
"clean:dist": "npm run rimraf -- dist",
"preclean:install": "npm run clean",
"clean:install": "npm set progress=false && npm install",
"preclean:start": "npm run clean",
"clean:start": "npm start",
"watch": "npm run watch:dev",
"watch:dev": "npm run build:dev -- --watch",
"watch:dev:hmr": "npm run watch:dev -- --hot",
"watch:test": "npm run test -- --auto-watch --no-single-run",
"watch:prod": "npm run build:prod -- --watch",
"build": "npm run build:dev",
"prebuild:dev": "npm run clean:dist",
"build:dev": "webpack --config config/webpack.dev.js --progress --profile --colors --display-error-details --display-cached",
"prebuild:prod": "npm run clean:dist",
"build:prod": "webpack --config config/webpack.prod.js --progress --profile --colors --display-error-details --display-cached --bail",
"server": "npm run server:dev",
"server:dev": "webpack-dev-server --config config/webpack.dev.js --inline --progress --profile --colors --watch --display-error-details --display-cached --content-base src/",
"server:dev:hmr": "npm run server:dev -- --hot",
"server:prod": "http-server dist --cors",
"webdriver:update": "npm run webdriver-manager update",
"webdriver:start": "npm run webdriver-manager start",
"lint": "npm run tslint 'src/**/*.ts'",
"pree2e": "npm run webdriver:update -- --standalone",
"e2e": "npm run protractor",
"e2e:live": "npm run e2e -- --elementExplorer",
"pretest": "npm run lint",
"test": "karma start",
"ci": "npm test && npm run e2e",
"docs": "npm run typedoc -- --options typedoc.json --exclude '**/*.spec.ts' ./src/",
"start": "npm run server:dev",
"start:hmr": "npm run server:dev:hmr",
"postinstall": "npm run typings -- install",
"preversion": "npm test",
"version": "npm run build",
"postversion": "git push && git push --tags"
},
"dependencies": {
"@angular/http": "2.0.0-rc.1",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/platform-server": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",

"bootstrap": "^4.0.0-alpha.2",
"bootstrap-loader": "^1.0.10",
"bootstrap-sass": "^3.3.6",
"core-js": "^2.4.0",
"jquery": "^2.2.4",
"node-sass": "^3.7.0",
"normalize.css": "^4.1.1",
"resolve-url-loader": "^1.4.3",
"rxjs": "5.0.0-beta.6",
"sass-loader": "^3.2.0",
"zone.js": "~0.6.12"
},
"devDependencies": {
"@angularclass/angular2-beta-to-rc-alias": "~0.0.3",

"angular2-hmr": "~0.7.0",

"awesome-typescript-loader": "~0.17.0",
"codelyzer": "~0.0.19",
"compression-webpack-plugin": "^0.3.1",
"copy-webpack-plugin": "^2.1.3",
"css-loader": "^0.23.1",
"es6-promise": "^3.1.2",
"es6-promise-loader": "^1.0.1",
"es6-shim": "^0.35.0",
"es7-reflect-metadata": "^1.6.0",

"exports-loader": "^0.6.3",
"expose-loader": "^0.7.1",
"file-loader": "^0.8.5",
"html-webpack-plugin": "^2.17.0",
"http-server": "^0.9.0",
"imports-loader": "^0.6.5",
"istanbul-instrumenter-loader": "^0.2.0",
"json-loader": "^0.5.4",
"karma": "^0.13.22",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.0.0",
Expand All @@ -98,44 +101,26 @@
"karma-phantomjs-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "1.7.0",

"protractor": "^3.2.2",

"node-sass": "^3.7.0",
"parse5": "^1.5.1",
"phantomjs-polyfill": "0.0.2",
"phantomjs-prebuilt": "^2.1.7",
"protractor": "^3.2.2",
"raw-loader": "0.5.1",
"remap-istanbul": "^0.6.3",
"resolve-url-loader": "^1.4.3",
"rimraf": "^2.5.2",

"codelyzer": "~0.0.19",

"tslint": "^3.7.1",
"sass-loader": "^3.2.0",
"source-map-loader": "^0.1.5",
"style-loader": "^0.13.1",
"ts-helpers": "1.1.1",
"ts-node": "^0.7.3",
"tslint": "^3.7.1",
"tslint-loader": "^2.1.3",
"typedoc": "^0.3.12",
"typescript": "~1.8.9",
"typings": "~1.0.3",

"awesome-typescript-loader": "~0.17.0",
"tslint-loader": "^2.1.3",
"url-loader": "^0.5.7",
"style-loader": "^0.13.1",
"raw-loader": "0.5.1",
"source-map-loader": "^0.1.5",
"imports-loader": "^0.6.5",
"istanbul-instrumenter-loader": "^0.2.0",
"json-loader": "^0.5.4",
"es6-promise-loader": "^1.0.1",
"css-loader": "^0.23.1",
"exports-loader": "^0.6.3",
"expose-loader": "^0.7.1",
"file-loader": "^0.8.5",
"http-server": "^0.9.0",

"html-webpack-plugin": "^2.17.0",
"compression-webpack-plugin": "^0.3.1",
"copy-webpack-plugin": "^2.1.3",

"webpack": "^1.12.14",
"webpack-dev-server": "^1.14.1",
"webpack-md5-hash": "^0.0.5",
Expand Down
2 changes: 2 additions & 0 deletions src/vendor.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import '@angular/router-deprecated';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/mergeMap';

import 'bootstrap-loader';

if ('production' === ENV) {
// Production

Expand Down

0 comments on commit e83f56d

Please sign in to comment.