Skip to content
This repository was archived by the owner on May 26, 2022. It is now read-only.

Commit 6bf6ce1

Browse files
committed
Do not look for goog.provide/require in comments
This is a workaround for the issue #16 "Incorrectly finds `goog.require` and `goog.provide` statements in comments"
1 parent c8e5521 commit 6bf6ce1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ function createPrefix(loaderContext, globalVarTree, globalVars, useEval) {
205205
module.exports = function loader(originalSource, inputSourceMap) {
206206
const self = this;
207207
const callback = this.async();
208-
let source = originalSource;
208+
let source = originalSource
209+
//.replace(/\/\/.*/g, '') // remove line comments (somehow this bugs)
210+
.replace(/\/\*[^]*?\*\//g, '/* stripped comment */'); // block comments
211+
209212
let globalVars = [];
210213
let exportedVars = [];
211214

0 commit comments

Comments
 (0)