Skip to content

Commit

Permalink
Upgrade dependency versions
Browse files Browse the repository at this point in the history
  • Loading branch information
NMFR committed Jun 28, 2019
1 parent 5cdda05 commit 110cc11
Show file tree
Hide file tree
Showing 14 changed files with 6,043 additions and 6,369 deletions.
12,266 changes: 5,990 additions & 6,276 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -30,18 +30,18 @@
]
},
"dependencies": {
"cssnano": "^4.1.0",
"cssnano": "^4.1.10",
"last-call-webpack-plugin": "^3.0.0"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-core": "^6.26.3",
"babel-jest": "^22.1.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"css-loader": "^0.28.9",
"babel-preset-env": "^1.7.0",
"css-loader": "^3.0.0",
"extract-text-webpack-plugin": "next",
"jest": "^22.1.4",
"jest": "^24.8.0",
"style-loader": "^0.20.1",
"webpack": "^4.9.1"
},
Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/webpack-integration.test.js.snap
Expand Up @@ -17,6 +17,6 @@ p {
"
`;

exports[`Webpack Integration Tests only-assetNameRegExp-processed 2`] = `"a{color:#00f}body{color:red;margin:0}p{margin:1000px}"`;
exports[`Webpack Integration Tests only-assetNameRegExp-processed 2`] = `"a{color:#00f}body{margin:0;color:red}p{margin:1000px}"`;

exports[`Webpack Integration Tests removes-duplicate-css 1`] = `"a{color:#00f}body{color:red}p{color:green}"`;
7 changes: 1 addition & 6 deletions test/cases/assetNameRegExp-no-source/a_optimize-me.css
@@ -1,6 +1 @@
body {
color: red;
}
a {
color: blue;
}
body{color:red}a{color:blue}
8 changes: 1 addition & 7 deletions test/cases/assetNameRegExp-no-source/b_optimize-me.css
@@ -1,7 +1 @@
body {
margin: 0;
color: red;
}
p {
margin: 1000px;
}
body{margin:0;color:red}p{margin:1000px}
10 changes: 1 addition & 9 deletions test/cases/assetNameRegExp-no-source/c.css
@@ -1,9 +1 @@
body {
color: red;
padding: 0;
margin: 0;
}
p {
padding: 500px;
padding: 1000px;
}
body{color:red;padding:0;margin:0}p{padding:500px;padding:1000px}
3 changes: 1 addition & 2 deletions test/cases/assetNameRegExp-no-source/webpack.config.js
Expand Up @@ -10,8 +10,7 @@ module.exports = {
use: ExtractTextPlugin.extract({
fallback: { loader: 'style-loader' },
use: {
loader: 'css-loader',
options: { minimize: true }
loader: 'css-loader'
}
})
},
Expand Down
7 changes: 1 addition & 6 deletions test/cases/duplicate-css-exists-without-plugin/a.css
@@ -1,6 +1 @@
body {
color: red;
}
a {
color: blue;
}
body{color:red}a{color:blue}
7 changes: 1 addition & 6 deletions test/cases/duplicate-css-exists-without-plugin/b.css
@@ -1,6 +1 @@
body {
color: red;
}
p {
color: green;
}
body{color:red}p{color:green}
19 changes: 8 additions & 11 deletions test/cases/duplicate-css-exists-without-plugin/webpack.config.js
@@ -1,23 +1,20 @@
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import OptimizeCssAssetsPlugin from '../../../src/';
import ExtractTextPlugin from "extract-text-webpack-plugin";
import OptimizeCssAssetsPlugin from "../../../src/";

module.exports = {
entry: './index',
entry: "./index",
module: {
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: { loader: 'style-loader' },
fallback: { loader: "style-loader" },
use: {
loader: 'css-loader',
options: { minimize: true }
loader: "css-loader"
}
})
},
],
}
]
},
plugins: [
new ExtractTextPlugin('file.css')
],
plugins: [new ExtractTextPlugin("file.css")]
};
@@ -1 +1 @@
a{color:#00f}body{color:red;margin:0}p{margin:1000px}
a{color:#00f}body{margin:0;color:red}p{margin:1000px}
24 changes: 11 additions & 13 deletions test/cases/only-assetNameRegExp-processed/webpack.config.js
@@ -1,40 +1,38 @@
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import OptimizeCssAssetsPlugin from '../../../src/';
import ExtractTextPlugin from "extract-text-webpack-plugin";
import OptimizeCssAssetsPlugin from "../../../src/";

const notToProcess = new ExtractTextPlugin('as_is.css');
const toProcess = new ExtractTextPlugin('optimize.css');
const notToProcess = new ExtractTextPlugin("as_is.css");
const toProcess = new ExtractTextPlugin("optimize.css");

module.exports = {
entry: './index',
entry: "./index",
module: {
rules: [
{
test: /as-is\.css$/,
use: notToProcess.extract({
fallback: { loader: 'style-loader' },
fallback: { loader: "style-loader" },
use: {
loader: 'css-loader',
options: { minimize: false }
loader: "css-loader"
}
})
},
{
test: /optimize-me\.css$/,
use: toProcess.extract({
fallback: { loader: 'style-loader' },
fallback: { loader: "style-loader" },
use: {
loader: 'css-loader',
options: { minimize: false }
loader: "css-loader"
}
})
}
],
]
},
plugins: [
notToProcess,
toProcess,
new OptimizeCssAssetsPlugin({
assetNameRegExp: /optimize\.css/g
})
],
]
};
20 changes: 8 additions & 12 deletions test/cases/removes-duplicate-css/webpack.config.js
@@ -1,24 +1,20 @@
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import OptimizeCssAssetsPlugin from '../../../src/';
import ExtractTextPlugin from "extract-text-webpack-plugin";
import OptimizeCssAssetsPlugin from "../../../src/";

module.exports = {
entry: './index',
entry: "./index",
module: {
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: { loader: 'style-loader' },
fallback: { loader: "style-loader" },
use: {
loader: 'css-loader',
options: { minimize: true }
loader: "css-loader"
}
})
},
],
}
]
},
plugins: [
new ExtractTextPlugin('file.css'),
new OptimizeCssAssetsPlugin()
],
plugins: [new ExtractTextPlugin("file.css"), new OptimizeCssAssetsPlugin()]
};
27 changes: 13 additions & 14 deletions test/util/helpers.js
@@ -1,40 +1,39 @@
import fs from 'fs';
import path from 'path';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import fs from "fs";
import path from "path";
import ExtractTextPlugin from "extract-text-webpack-plugin";

export function readFileOrEmpty(path) {
try {
return fs.readFileSync(path, 'utf-8');
return fs.readFileSync(path, "utf-8");
} catch (e) {
return '';
return "";
}
}

export const defaultConfig = {
entry: './index',
entry: "./index",
module: {
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: { loader: 'style-loader' },
fallback: { loader: "style-loader" },
use: {
loader: 'css-loader',
options: { minimize: true }
loader: "css-loader"
}
})
},
],
}
]
},
plugins: [],
context: __dirname,
output: {
filename: 'destination.js',
path: path.resolve(__dirname, '../', 'js', 'default-exports')
filename: "destination.js",
path: path.resolve(__dirname, "../", "js", "default-exports")
}
};

export function checkForWebpackErrors({err, stats, done}) {
export function checkForWebpackErrors({ err, stats, done }) {
if (err) return done(err);
if (stats.hasErrors()) return done(new Error(stats.toString()));
}

0 comments on commit 110cc11

Please sign in to comment.