Skip to content
This repository was archived by the owner on May 26, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
collectCoverage: true,
collectCoverageFrom: ['lib/**/*.js'],
testEnvironment: 'node',
coverageThreshold: {
global: {
statements: 87.67,
Expand Down
10 changes: 3 additions & 7 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,25 +204,21 @@ function createPrefix(loaderContext, globalVarTree, globalVars, useEval) {

module.exports = function loader(originalSource, inputSourceMap) {
const self = this;
let { query } = this;
const callback = this.async();
let source = originalSource;
let globalVars = [];
let exportedVars = [];

if (typeof query === 'string' && query.length > 0) {
query = loaderUtils.parseQuery(this.query);
}

if (this.cacheable) {
this.cacheable();
}

const options = loaderUtils.getOptions(this);
const config = merge(
{},
defaultConfig,
this.options[query.config || 'closureLoader'],
query,
this.options ? this.options[options.config || 'closureLoader'] : {},
options,
);

mapBuilder(config.paths, config.watch, config.fileExt)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"imports-loader": "^0.8.0",
"jest": "^22.4.3",
"memory-fs": "^0.4.1",
"webpack": "^3.11.0",
"webpack": "^4.5.0",
"webpack-merge": "^4.1.2"
}
}
Loading