Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.

Commit 9828262

Browse files
committed
remove webpack dep
Change-Id: I09b08531bc6da66628d7636cb599250b389a4c53
1 parent 009cd22 commit 9828262

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/webpack.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@
2323
module.exports = function(args) {
2424
const compile = require('../compile');
2525
const logger = require('../logger');
26-
const ModuleFilenameHelpers = require('webpack/lib/ModuleFilenameHelpers');
2726
const RawSource = require('webpack-core/lib/RawSource');
2827
const SourceMapSource = require('webpack-core/lib/SourceMapSource');
2928

30-
args.test = args.test || /\.js($|\?)/i;
29+
args.test = args.test ? new RegExp(args.test) : /\.js($|\?)/i;
3130

3231
this.apply = function(compiler) {
3332
compiler.plugin('compilation', compilation => {
@@ -37,7 +36,7 @@ module.exports = function(args) {
3736

3837
compilation.plugin('optimize-chunk-assets', (chunks, callback) => {
3938
chunks.forEach(chunk => {
40-
const files = chunk.files.filter(name => ModuleFilenameHelpers.matchObject(args, name));
39+
const files = chunk.files.filter(name => args.test.test(name));
4140
files.forEach(name => {
4241
const options = args.options; // TODO
4342

0 commit comments

Comments
 (0)