This repository has been archived by the owner on Feb 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update dependencies including purgecss 1.3.0
- Loading branch information
Showing
5 changed files
with
88 additions
and
88 deletions.
There are no files selected for viewing
94 changes: 47 additions & 47 deletions
94
__tests__/cases/path-and-whitelist-functions/webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
const path = require("path"); | ||
const glob = require("glob"); | ||
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | ||
const PurgecssPlugin = require("../../../src/").default; | ||
const path = require('path') | ||
const glob = require('glob') | ||
const MiniCssExtractPlugin = require('mini-css-extract-plugin') | ||
const PurgecssPlugin = require('../../../src/').default | ||
|
||
class CustomExtractor { | ||
static extract(content) { | ||
return content.match(/[A-z0-9-:/]+/g); | ||
} | ||
static extract(content) { | ||
return content.match(/[A-z0-9-:/]+/g) | ||
} | ||
} | ||
|
||
const PATHS = { | ||
src: path.join(__dirname, "src") | ||
}; | ||
src: path.join(__dirname, 'src') | ||
} | ||
|
||
module.exports = { | ||
mode: "development", | ||
entry: "./src/index.js", | ||
optimization: { | ||
splitChunks: { | ||
cacheGroups: { | ||
styles: { | ||
name: "styles", | ||
test: /\.css$/, | ||
chunks: "all", | ||
enforce: true | ||
mode: 'development', | ||
entry: './src/index.js', | ||
optimization: { | ||
splitChunks: { | ||
cacheGroups: { | ||
styles: { | ||
name: 'styles', | ||
test: /\.css$/, | ||
chunks: 'all', | ||
enforce: true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/, | ||
use: [MiniCssExtractPlugin.loader, "css-loader"] | ||
} | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/, | ||
use: [MiniCssExtractPlugin.loader, 'css-loader'] | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new MiniCssExtractPlugin({ | ||
filename: '[name].css' | ||
}), | ||
new PurgecssPlugin({ | ||
paths: () => glob.sync(`${PATHS.src}/*`), | ||
whitelist: () => ['whitelisted'], | ||
whitelistPatterns: () => [/^whitelistedPat/], | ||
whitelistPatternsChildren: () => [/^whitelistedPatternChildren/], | ||
extractors: [ | ||
{ | ||
extractor: CustomExtractor, | ||
extensions: ['html', 'js'] | ||
} | ||
] | ||
}) | ||
] | ||
}, | ||
plugins: [ | ||
new MiniCssExtractPlugin({ | ||
filename: "[name].css" | ||
}), | ||
new PurgecssPlugin({ | ||
paths: () => glob.sync(`${PATHS.src}/*`), | ||
whitelist: () => ["whitelisted"], | ||
whitelistPatterns: () => [/^whitelistedPat/], | ||
whitelistPatternsChildren: () => [/^whitelistedPatternChildren/], | ||
extractors: [ | ||
{ | ||
extractor: CustomExtractor, | ||
extensions: ["html", "js"] | ||
} | ||
] | ||
}) | ||
] | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters