Skip to content

Commit

Permalink
chore: drop support for old node & webpack version
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Drop support for:
- [email protected]
- [email protected]
- webpack@1
  • Loading branch information
mastilver committed Aug 9, 2017
1 parent 4c7c166 commit 43b48f1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 40 deletions.
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ node_js:
- '8'
- '6'
- '4'
- '0.12'
- '0.10'

env:
- WEBPACK_VERSION=1 EXTRACT_PLUGIN_VERSION=1
- WEBPACK_VERSION=2 EXTRACT_PLUGIN_VERSION=2
- WEBPACK_VERSION=3 EXTRACT_PLUGIN_VERSION=3.0.0-rc.1

Expand All @@ -16,10 +13,7 @@ install:
- npm install webpack@$WEBPACK_VERSION extract-text-webpack-plugin@$EXTRACT_PLUGIN_VERSION || true

script:
# TODO: remove when dropping support for node 0.10 and 0.12
- if [ ${TRAVIS_NODE_VERSION} != "0.10" ] && [ ${TRAVIS_NODE_VERSION} != "0.12" ] || [ ${WEBPACK_VERSION} == "1" ]; then
npm test;
fi
- npm test;

after_script:
- './node_modules/.bin/nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov'
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
"author": "Dane Thurber <[email protected]>",
"license": "MIT",
"engines": {
"node": ">=0.10"
"node": ">=4"
},
"peerDependencies": {
"webpack": "1 || 2 || 3"
"webpack": "2 || 3"
},
"devDependencies": {
"codecov": "^2.2.0",
"css-loader": "^0.9.1",
"extract-text-webpack-plugin": "^0.5.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.9.0",
"jasmine": "^2.2.1",
"memory-fs": "^0.2.0",
"nyc": "^10.3.2",
"rimraf": "^2.6.1",
"style-loader": "^0.8.3",
"webpack": "^1.7.3"
"webpack": "^3.5.2"
},
"files": [
"index.js",
Expand Down
3 changes: 1 addition & 2 deletions spec/plugin.integration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ describe('ManifestPlugin using real fs', function() {
hashes.push(stats.hash);

if (hashes.length === 2) {
// TODO: uncomment when dropping support for node@10
// expect(hashes[0]).not.toEqual(hashes[1]);
expect(hashes[0]).not.toEqual(hashes[1]);
return done();
}

Expand Down
33 changes: 6 additions & 27 deletions spec/plugin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,8 @@ var MemoryFileSystem = require('memory-fs');
var webpack = require('webpack');
var _ = require('lodash');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var extractTextPluginMajorVersion = require('extract-text-webpack-plugin/package.json').version.split('.')[0];
var plugin = require('../index.js');

// TODO: remove when dropping support for webpack@1
if (Number(extractTextPluginMajorVersion) > 1) {
function FakeExtractTextPlugin(fileName, opts) {
ExtractTextPlugin.call(this, _.assign(
opts,
{
filename: fileName
}
));
}

FakeExtractTextPlugin.prototype = Object.create(ExtractTextPlugin.prototype);
FakeExtractTextPlugin.prototype.constructor = FakeExtractTextPlugin;

FakeExtractTextPlugin.extract = function (fallback, use) {
return ExtractTextPlugin.extract({
fallback: fallback,
use: use
});
};
} else {
FakeExtractTextPlugin = ExtractTextPlugin;
}

var OUTPUT_DIR = path.join(__dirname, './webpack-out');
var manifestPath = path.join(OUTPUT_DIR, 'manifest.json');

Expand Down Expand Up @@ -405,12 +380,16 @@ describe('ManifestPlugin', function() {
module: {
loaders: [{
test: /\.css$/,
loader: FakeExtractTextPlugin.extract('style-loader', 'css-loader')
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader'
})
}]
},
plugins: [
new plugin(),
new FakeExtractTextPlugin('[name].css', {
new ExtractTextPlugin({
filename: '[name].css',
allChunks: true
})
]
Expand Down

0 comments on commit 43b48f1

Please sign in to comment.