Skip to content

Commit 8b44d97

Browse files
committed
Remove ExtractTextPlugin
1 parent a98f761 commit 8b44d97

File tree

5 files changed

+7
-116
lines changed

5 files changed

+7
-116
lines changed

webpack/bootstrap-sass.config.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,9 @@ module.exports = {
55
// Default for the style loading is to put in your js files
66
// styleLoader: "style-loader!css-loader!sass-loader";
77

8-
// If you want to use the ExtractTextPlugin
9-
// and you want compressed
10-
// styleLoader: ExtractTextPlugin.extract("style-loader", "css-loader!sass-loader"),
11-
// or if you want expanded CSS
12-
// styleLoader: ExtractTextPlugin.extract("style-loader", "css-loader!sass?outputStyle=expanded"),
13-
148
// ### Scripts
15-
// Any scripts here set to false will never
16-
// make it to the client, it's not packaged
17-
// by webpack.
9+
// Any scripts here set to false will never make it to the client,
10+
// i.e. it's not packaged by webpack.
1811
scripts: {
1912
'transition': true,
2013
'alert': true,

webpack/bootstrap-sass.extract-text-plugin.config.js

Lines changed: 0 additions & 85 deletions
This file was deleted.

webpack/webpack.common.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ module.exports = {
1111
// jquery: "var jQuery"
1212
// },
1313
resolve: {
14-
root: [ path.join(__dirname, "scripts"), path.join(__dirname, "assets/javascripts"),
15-
path.join(__dirname, "assets/stylesheets") ],
14+
root: [path.join(__dirname, "scripts"), path.join(__dirname, "assets/javascripts"),
15+
path.join(__dirname, "assets/stylesheets")],
1616
extensions: ["", ".webpack.js", ".web.js", ".js", ".jsx", ".scss", ".css", "config.js"]
1717
},
1818
module: {

webpack/webpack.hot.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var webpack = require("webpack");
44
config.entry.push("webpack-dev-server/client?http://localhost:3000",
55
"webpack/hot/dev-server",
66
"./scripts/webpack_only");
7-
config.output = { filename: "express-bundle.js", // this file is never saved
7+
config.output = { filename: "express-bundle.js", // this file is never saved on disk
88
path: __dirname };
99
config.plugins = [ new webpack.HotModuleReplacementPlugin() ];
1010
module.exports = config;

webpack/webpack.rails.config.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
// Run like this
2-
// cd webpack && webpack -w --config webpack.rails.config.js
2+
// cd webpack && $(npm bin)/webpack -w --config webpack.rails.config.js
33

44
var config = require("./webpack.common.config");
55
var path = require("path");
6-
var ExtractTextPlugin = require("extract-text-webpack-plugin");
76

87
// Add the following entries as appropriate:
98
// "./scripts/rails_only" --> rails specific assets
109
// "bootstrap-sass-loader" --> all bootstrap assets
1110
// "bootstrap-sass!./bootstrap-sass.config.js" --> custom bootstrap
12-
// "bootstrap-sass!./bootstrap-sass.extract-text-plugin.config.js" --> custom bootstrap w/ separate css bundle (see https://github.com/webpack/extract-text-webpack-plugin)
1311
config.entry.push("./assets/javascripts/example",
14-
"bootstrap-sass!./bootstrap-sass.extract-text-plugin.config.js");
12+
"bootstrap-sass!./bootstrap-sass.config.js");
1513
config.output = { filename: "rails-bundle.js",
1614
path: "../app/assets/javascripts" };
1715
config.externals = { jquery: "var jQuery" }; // load jQuery from cdn or rails asset pipeline
@@ -20,32 +18,17 @@ config.module.loaders.push(
2018
// bootstrap-sass-loader has access to the jQuery object
2119
{ test: /bootstrap-sass\/assets\/javascripts\//, loader: "imports?jQuery=jquery" },
2220
{ test: /\.scss$/, loader: "style!css!sass?outputStyle=expanded&imagePath=/assets/images"},
23-
//{ test: /\.jsx$/, loaders: ['es6', 'jsx?harmony'] },
2421
// Next 2 lines expose jQuery and $ to any JavaScript files loaded after rails-bundle.js
2522
// in the Rails Asset Pipeline. Thus, load this one prior.
2623
{ test: require.resolve("jquery"), loader: "expose?jQuery" },
2724
{ test: require.resolve("jquery"), loader: "expose?$" }
2825
);
29-
// Load Bootstrap's CSS
30-
// Needed for the css-loader when [bootstrap-sass-loader]
31-
//{ test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
32-
// loader: "url?limit=10000&minetype=application/font-woff" },
33-
//{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
34-
// loader: "url?limit=10000&minetype=application/octet-stream" },
35-
//{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
36-
// loader: "file" },
37-
//{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
38-
// loader: "url?limit=10000&minetype=image/svg+xml" },
39-
config.plugins = [ new ExtractTextPlugin("../stylesheets/bootstrap-and-customizations.css") ];
4026
module.exports = config;
4127

4228
var devBuild = (typeof process.env["BUILDPACK_URL"]) === "undefined";
4329
if (devBuild) {
4430
console.log("Webpack dev build for Rails");
4531
//module.exports.devtool = "eval-source-map";
46-
//module.exports.module.loaders.push(
47-
// { test: require.resolve("react"), loader: "expose?React" }
48-
//);
4932
} else {
5033
console.log("Webpack production build for Rails");
5134
}

0 commit comments

Comments
 (0)