Skip to content

Commit 0d2b98e

Browse files
committed
extract vendor css to another file
1 parent 0393b4a commit 0d2b98e

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

config/webpack.common.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const helpers = require('./helpers');
33

44
const HtmlWebpackPlugin = require('html-webpack-plugin');
55
const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin;
6+
const ExtractTextPlugin = require("extract-text-webpack-plugin");
67

78
module.exports = {
89
entry: {
@@ -32,7 +33,10 @@ module.exports = {
3233
{
3334
test: /\.css$/,
3435
exclude: [helpers.root('src')],
35-
loaders: ['style', 'css'],
36+
loader: ExtractTextPlugin.extract({
37+
fallbackLoader: "style-loader",
38+
loader: "css-loader",
39+
}),
3640
},
3741
{test: /\.html$/, loader: 'raw-loader'},
3842
]
@@ -51,6 +55,7 @@ module.exports = {
5155
new webpack.optimize.CommonsChunkPlugin({
5256
name: ['polyfills', 'vendor'].reverse()
5357
}),
58+
new ExtractTextPlugin('[name].[chunkhash].css'),
5459
],
5560
node: {
5661
global: true,

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"codelyzer": "~1.0.0-beta.0",
6363
"css-loader": "^0.25.0",
6464
"express": "^4.14.0",
65+
"extract-text-webpack-plugin": "^2.0.0-beta.4",
6566
"html-webpack-plugin": "^2.24.1",
6667
"http-proxy": "^1.15.1",
6768
"jasmine-core": "^2.4.1",

yarn.lock

+10-2
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ async@^0.9.0, async@~0.9.0:
266266
version "0.9.2"
267267
resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d"
268268

269-
async@^1.3.0:
269+
async@^1.3.0, async@^1.5.0:
270270
version "1.5.2"
271271
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
272272

@@ -1352,6 +1352,14 @@ extglob@^0.3.1:
13521352
dependencies:
13531353
is-extglob "^1.0.0"
13541354

1355+
extract-text-webpack-plugin@^2.0.0-beta.4:
1356+
version "2.0.0-beta.4"
1357+
resolved "https://registry.yarnpkg.com/extract-text-webpack-plugin/-/extract-text-webpack-plugin-2.0.0-beta.4.tgz#d32393069e7d90c8318d48392302618b56bc1ba9"
1358+
dependencies:
1359+
async "^1.5.0"
1360+
loader-utils "^0.2.3"
1361+
webpack-sources "^0.1.0"
1362+
13551363
extsprintf@1.0.2:
13561364
version "1.0.2"
13571365
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550"
@@ -2136,7 +2144,7 @@ loader-runner@^2.2.0:
21362144
version "2.2.0"
21372145
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.2.0.tgz#824c1b699c4e7a2b6501b85902d5b862bf45b3fa"
21382146

2139-
loader-utils@^0.2.11, loader-utils@^0.2.15, loader-utils@^0.2.16, loader-utils@^0.2.5, loader-utils@^0.2.6, loader-utils@^0.2.7, loader-utils@~0.2.2:
2147+
loader-utils@^0.2.11, loader-utils@^0.2.15, loader-utils@^0.2.16, loader-utils@^0.2.3, loader-utils@^0.2.5, loader-utils@^0.2.6, loader-utils@^0.2.7, loader-utils@~0.2.2:
21402148
version "0.2.16"
21412149
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.16.tgz#f08632066ed8282835dff88dfb52704765adee6d"
21422150
dependencies:

0 commit comments

Comments
 (0)