Skip to content

Commit

Permalink
ENYO-4653: Abnormal behaviour with 'serve'.
Browse files Browse the repository at this point in the history
Use a local fork of extract-text-webpack plugin with a webpack 3.x compatibility patch applied until webpack-contrib/extract-text-webpack-plugin#579 is fixed upstream.
  • Loading branch information
JayCanuck committed Sep 11, 2017
1 parent f340524 commit 8daf25d
Show file tree
Hide file tree
Showing 137 changed files with 1,879 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extract-text-webpack-plugin
node_modules
17 changes: 17 additions & 0 deletions extract-text-webpack-plugin/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
12 changes: 12 additions & 0 deletions extract-text-webpack-plugin/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"env": {
"node": true
},
"rules": {
"strict": 0,
"curly": 0,
"quotes": 0,
"no-shadow": 0,
"no-underscore-dangle": 0
}
}
1 change: 1 addition & 0 deletions extract-text-webpack-plugin/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
5 changes: 5 additions & 0 deletions extract-text-webpack-plugin/.github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1. Check the version of package you are using. If it's not the newest version, update and try again (see changelog while updating!).
2. If the issue is still there, write a minimal project showing the problem and expected output.
3. Link to the project and mention Node version and OS in your report.

**IMPORTANT! You should use [Stack Overflow](https://stackoverflow.com/) for support related questions.**
4 changes: 4 additions & 0 deletions extract-text-webpack-plugin/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1. [Read and sign the CLA](https://cla.js.foundation/webpack/webpack.js.org). This needs to be done only once. PRs that haven't signed it won't be accepted.
2. Check out the [development guide](https://webpack.js.org/development/) for the API and development guidelines.
3. Read through the PR diff carefully as sometimes this can reveal issues. The work will be reviewed, but this can save some effort.
4. Remove these instructions from your PR as they are for your eyes only.
10 changes: 10 additions & 0 deletions extract-text-webpack-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/node_modules

/example/assets

/test/js
/coverage

/.idea

.DS_Store
12 changes: 12 additions & 0 deletions extract-text-webpack-plugin/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sudo: false
language: node_js
node_js:
- node
- 6
- 4
script: npm run travis

after_success:
- cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose
- cat ./coverage/coverage.json | node_modules/codecov.io/bin/codecov.io.js
- rm -rf ./coverage
77 changes: 77 additions & 0 deletions extract-text-webpack-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Change Log

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="2.1.2"></a>
## [2.1.2](https://github.com/webpack-contrib/extract-text-webpack-plugin/compare/v2.1.1...v2.1.2) (2017-06-08)



<a name="2.1.1"></a>
## [2.1.1](https://github.com/webpack-contrib/extract-text-webpack-plugin/compare/v2.1.0...v2.1.1) (2017-06-08)


### Bug Fixes

* add a not null check for the content property before throwing error ([#404](https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/404)) ([58dd5d3](https://github.com/webpack-contrib/extract-text-webpack-plugin/commit/58dd5d3))
* **loader:** rm unnecessary `this.cacheable` (caching) ([#530](https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/530)) ([c3cb091](https://github.com/webpack-contrib/extract-text-webpack-plugin/commit/c3cb091))
* don't extract from common async chunks ([#508](https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/508)) ([e595417](https://github.com/webpack-contrib/extract-text-webpack-plugin/commit/e595417))
* validation schema (`schema-utils`) ([#527](https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/527)) ([dfeb347](https://github.com/webpack-contrib/extract-text-webpack-plugin/commit/dfeb347))



<a name="2.1.0"></a>
# [2.1.0](https://github.com/webpack/extract-text-webpack-plugin/compare/v2.0.0...v2.1.0) (2017-03-05)

### Features

* The plugin **filename** accepts a function now. [c9a19ad](https://github.com/webpack-contrib/extract-text-webpack-plugin/commit/c9a19ad), closes [#423](https://github.com/webpack-contrib/extract-text-webpack-plugin/pull/423)

<a name="2.0.0"></a>
# [2.0.0](https://github.com/webpack/extract-text-webpack-plugin/compare/v2.0.0-rc.3...v2.0.0) (2017-02-24)

<a name="2.0.0-rc.2"></a>
# [2.0.0-rc.2](https://github.com/webpack/extract-text-webpack-plugin/compare/v2.0.0-rc.1...v2.0.0-rc.2) (2017-01-28)


### Bug Fixes

* **schema:** allow `extract` to accept omit/remove flags ([8ce93d5](https://github.com/webpack/extract-text-webpack-plugin/commit/8ce93d5)), closes [#371](https://github.com/webpack/extract-text-webpack-plugin/issues/371)
* **schema:** connect loader schema with the code properly ([03bb4aa](https://github.com/webpack/extract-text-webpack-plugin/commit/03bb4aa))
* **schema:** emit proper error messages ([70cbd4b](https://github.com/webpack/extract-text-webpack-plugin/commit/70cbd4b))


### Features

* **errors:** show nicer errors if there are extra fields ([76a171d](https://github.com/webpack/extract-text-webpack-plugin/commit/76a171d))



<a name="2.0.0-rc.1"></a>
# [2.0.0-rc.1](https://github.com/webpack/extract-text-webpack-plugin/compare/v2.0.0-rc.0...v2.0.0-rc.1) (2017-01-28)


### Bug Fixes

* **options:** pass proper loader options to children ([#266](https://github.com/webpack/extract-text-webpack-plugin/issues/266)) ([6abf42d](https://github.com/webpack/extract-text-webpack-plugin/commit/6abf42d))



<a name="2.0.0-rc.0"></a>
# [2.0.0-rc.0](https://github.com/webpack/extract-text-webpack-plugin/compare/v2.0.0-beta.5...v2.0.0-rc.0) (2017-01-26)


### Bug Fixes

* **readme:** Incorrect loader configuration ([e477cc7](https://github.com/webpack/extract-text-webpack-plugin/commit/e477cc7))


### Features

* **extract:** return an array of loader objects ([#343](https://github.com/webpack/extract-text-webpack-plugin/issues/343)) ([74b86e0](https://github.com/webpack/extract-text-webpack-plugin/commit/74b86e0))



# Change Log

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
70 changes: 70 additions & 0 deletions extract-text-webpack-plugin/ExtractedModule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var SourceMapSource = require("webpack-sources").SourceMapSource;
var RawSource = require("webpack-sources").RawSource;

function ExtractedModule(identifier, originalModule, source, sourceMap, addtitionalInformation, prevModules) {
this._identifier = identifier;
this._originalModule = originalModule;
this._source = source;
this._sourceMap = sourceMap;
this._prevModules = prevModules;
this.addtitionalInformation = addtitionalInformation;
this.chunks = [];
}
module.exports = ExtractedModule;

ExtractedModule.prototype.getOrder = function() {
// http://stackoverflow.com/a/14676665/1458162
return /^@import url/.test(this._source) ? 0 : 1;
};

ExtractedModule.prototype.addChunk = function(chunk) {
var idx = this.chunks.indexOf(chunk);
if(idx < 0)
this.chunks.push(chunk);
};

ExtractedModule.prototype.removeChunk = function(chunk) {
var idx = this.chunks.indexOf(chunk);
if(idx >= 0) {
this.chunks.splice(idx, 1);
chunk.removeModule(this);
return true;
}
return false;
};

ExtractedModule.prototype.rewriteChunkInReasons = function(oldChunk, newChunks) { };

ExtractedModule.prototype.identifier = function() {
return this._identifier;
};

ExtractedModule.prototype.source = function() {
if(this._sourceMap)
return new SourceMapSource(this._source, null, this._sourceMap);
else
return new RawSource(this._source);
};

ExtractedModule.prototype.getOriginalModule = function() {
return this._originalModule;
};

ExtractedModule.prototype.getPrevModules = function() {
return this._prevModules;
};

ExtractedModule.prototype.addPrevModules = function(prevModules) {
prevModules.forEach(function(m) {
if(this._prevModules.indexOf(m) < 0)
this._prevModules.push(m);
}, this);
};

ExtractedModule.prototype.setOriginalModule = function(originalModule) {
this._originalModule = originalModule;
};
20 changes: 20 additions & 0 deletions extract-text-webpack-plugin/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright JS Foundation and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14 changes: 14 additions & 0 deletions extract-text-webpack-plugin/OrderUndefinedError.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
function OrderUndefinedError(module) {
Error.call(this);
Error.captureStackTrace(this, OrderUndefinedError);
this.name = "OrderUndefinedError";
this.message = "Order in extracted chunk undefined";
this.module = module;
}
module.exports = OrderUndefinedError;

OrderUndefinedError.prototype = Object.create(Error.prototype);

0 comments on commit 8daf25d

Please sign in to comment.