Skip to content

Commit

Permalink
deps: update deps css-loader@0.19.0 extract-text-webpack-plugin@0.8.2…
Browse files Browse the repository at this point in the history
… and update test cases
  • Loading branch information
soda-x committed Sep 24, 2015
1 parent 0e625bf commit e0bb3e6
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 91 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"coffee-script": "~1.9.3",
"colorful": "~2.1.0",
"commander": "~2.7.1",
"css-loader": "~0.14.5",
"css-loader": "~0.19.0",
"css-resources": "~0.2.0",
"extend": "~2.0.0",
"extract-text-webpack-plugin": "~0.3.8",
"extract-text-webpack-plugin": "~0.8.2",
"file-loader": "~0.8.1",
"fs-extra": "~0.16.5",
"glob": "~5.0.1",
Expand Down
4 changes: 1 addition & 3 deletions test/expected/css-output/a.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.c {
color: #111;
}

.a { color: red; }
}.a { color: red; }
3 changes: 1 addition & 2 deletions test/expected/css-output/b.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.c {
color: #111;
}
.b {
}.b {
color: red;
}
2 changes: 1 addition & 1 deletion test/expected/html-minify-enable/a.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/expected/require-css-min/a.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

210 changes: 128 additions & 82 deletions test/expected/require-css/a.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,45 +44,131 @@
/* 0 */
/***/ function(module, exports, __webpack_require__) {


__webpack_require__(1);
console.log(1);
module.exports = __webpack_require__(7);


/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
/***/ function(module, exports) {

// style-loader: Adds some css to the DOM by adding a <style> tag
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function() {
var list = [];

// return the list of modules as css string
list.toString = function toString() {
var result = [];
for(var i = 0; i < this.length; i++) {
var item = this[i];
if(item[2]) {
result.push("@media " + item[2] + "{" + item[1] + "}");
} else {
result.push(item[1]);
}
}
return result.join("");
};

// import a list of modules into the list
list.i = function(modules, mediaQuery) {
if(typeof modules === "string")
modules = [[null, modules, ""]];
var alreadyImportedModules = {};
for(var i = 0; i < this.length; i++) {
var id = this[i][0];
if(typeof id === "number")
alreadyImportedModules[id] = true;
}
for(i = 0; i < modules.length; i++) {
var item = modules[i];
// skip already imported module
// this implementation is not 100% perfect for weird media query combinations
// when a module is imported multiple times with different media queries.
// I hope this will never occur (Hey this way we have smaller bundles)
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
if(mediaQuery && !item[2]) {
item[2] = mediaQuery;
} else if(mediaQuery) {
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
}
list.push(item);
}
}
};
return list;
};

// load the styles
var content = __webpack_require__(2);
if(typeof content === 'string') content = [[module.id, content, '']];
// add the styles to the DOM
var update = __webpack_require__(3)(content, {});
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
module.hot.accept("!!/Users/chencheng/Documents/Work/Libraries/alipay/spm-family/spm-webpack/node_modules/css-loader/index.js!/Users/chencheng/Documents/Work/Libraries/alipay/spm-family/spm-webpack/test/fixtures/require-css/a.css", function() {
var newContent = require("!!/Users/chencheng/Documents/Work/Libraries/alipay/spm-family/spm-webpack/node_modules/css-loader/index.js!/Users/chencheng/Documents/Work/Libraries/alipay/spm-family/spm-webpack/test/fixtures/require-css/a.css");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}

/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(5)();
__webpack_require__(6)(exports, __webpack_require__(4), "");
__webpack_require__(6)(exports, __webpack_require__(7), "");
exports.push([module.id, "\n\n\na {\n color: green;\n background: url("+__webpack_require__(8)+");\n}\n\n\n", ""]);
exports = module.exports = __webpack_require__(1)();
// imports
exports.i(__webpack_require__(4), "");
exports.i(__webpack_require__(3), "");

// module
exports.push([module.id, "\na {\n color: green;\n background: url(" + __webpack_require__(5) + ");\n}\n", ""]);

// exports


/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(1)();
// imports


// module
exports.push([module.id, ".relative {\n color: black;\n}\n", ""]);

// exports


/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(1)();
// imports


// module
exports.push([module.id, "b {\n color: red;\n background: url(" + __webpack_require__(6) + ");\n}\n", ""]);

// exports


/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {

module.exports = __webpack_require__.p + "f6ead467753497971acc9dc7a6897dfe.png"

/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {

module.exports = __webpack_require__.p + "bd98d83ae100b3e9a2fd351c5a2178e9.png"

/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {


__webpack_require__(9);
console.log(1);


/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {

/*
Expand Down Expand Up @@ -278,67 +364,27 @@


/***/ },
/* 4 */
/* 9 */
/***/ function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(5)();
exports.push([module.id, "b {\n color: red;\n background: url("+__webpack_require__(9)+");\n}\n", ""]);

/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag

module.exports = function() {
var list = [];
list.toString = function toString() {
var result = [];
for(var i = 0; i < this.length; i++) {
var item = this[i];
if(item[2]) {
result.push("@media " + item[2] + "{" + item[1] + "}");
} else {
result.push(item[1]);
}
}
return result.join("");
};
return list;
// load the styles
var content = __webpack_require__(2);
if(typeof content === 'string') content = [[module.id, content, '']];
// add the styles to the DOM
var update = __webpack_require__(8)(content, {});
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
module.hot.accept("!!/Users/pigcan/workspace/github/spmfamily/spm-webpack/node_modules/css-loader/index.js!!/Users/pigcan/workspace/require-css/a.css", function() {
var newContent = require("!!/Users/pigcan/workspace/github/spmfamily/spm-webpack/node_modules/css-loader/index.js!!/Users/pigcan/workspace/require-css/a.css");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}

/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {

module.exports = function(list, importedList, media) {
for(var i = 0; i < importedList.length; i++) {
var item = importedList[i];
if(media && !item[2])
item[2] = media;
else if(media) {
item[2] = "(" + item[2] + ") and (" + media + ")";
}
list.push(item);
}
};

/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(5)();
exports.push([module.id, ".relative {\n color: black;\n}\n", ""]);

/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {

module.exports = __webpack_require__.p + "f6ead467753497971acc9dc7a6897dfe.png"

/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {

module.exports = __webpack_require__.p + "bd98d83ae100b3e9a2fd351c5a2178e9.png"

/***/ }
/******/ ]);

0 comments on commit e0bb3e6

Please sign in to comment.