This repository has been archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ExtractTextPlugin): update to new plugin system and API's (#707
- Loading branch information
1 parent
10a1785
commit 51c56c0
Showing
13 changed files
with
6,972 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,46 @@ | ||
var webpack = require("webpack"); | ||
var ExtractTextPlugin = require("../"); | ||
const ExtractTextPlugin = require('../'); | ||
|
||
module.exports = { | ||
entry: { | ||
a: "./entry.js", | ||
b: "./entry2.js" | ||
}, | ||
output: { | ||
filename: "[name].js?[hash]-[chunkhash]", | ||
chunkFilename: "[name].js?[hash]-[chunkhash]", | ||
path: __dirname + "/assets", | ||
publicPath: "/assets/" | ||
}, | ||
module: { | ||
loaders: [ | ||
{ test: /\.css$/, use: ExtractTextPlugin.extract({ | ||
fallback: "style-loader", | ||
use: { | ||
loader: "css-loader", | ||
options: { | ||
sourceMap: true | ||
} | ||
}, | ||
publicPath: "../" | ||
}) }, | ||
{ test: /\.png$/, loader: "file-loader" } | ||
] | ||
}, | ||
devtool: "source-map", | ||
plugins: [ | ||
new ExtractTextPlugin({ | ||
filename: "css/[name].css?[hash]-[chunkhash]-[contenthash]-[name]", | ||
disable: false, | ||
allChunks: true | ||
}), | ||
new webpack.optimize.CommonsChunkPlugin({ name: "c", filename: "c.js" }) | ||
] | ||
entry: { | ||
a: './entry.js', | ||
b: './entry2.js', | ||
}, | ||
output: { | ||
filename: '[name].js?[hash]-[chunkhash]', | ||
chunkFilename: '[name].js?[hash]-[chunkhash]', | ||
path: `${__dirname}/assets`, | ||
publicPath: '/assets/', | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.css$/, | ||
use: ExtractTextPlugin.extract({ | ||
fallback: 'style-loader', | ||
use: { | ||
loader: 'css-loader', | ||
options: { | ||
sourceMap: true, | ||
}, | ||
}, | ||
publicPath: '../', | ||
}), | ||
}, | ||
{ test: /\.png$/, loader: 'file-loader' }, | ||
], | ||
}, | ||
devtool: 'source-map', | ||
optimization: { | ||
splitChunks: { | ||
chunks: 'all', | ||
name: 'c', | ||
}, | ||
}, | ||
plugins: [ | ||
new ExtractTextPlugin({ | ||
filename: 'css/[name].css?[hash]-[chunkhash]-[contenthash]-[name]', | ||
disable: false, | ||
allChunks: true, | ||
}), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.