MCPcopy Index your code
hub / github.com/codecombat/codecombat / apply

Method apply

webpack.base.config.js:49–75  ·  view source on GitHub ↗
(resolver)

Source from the content-addressed store, hash-verified

47class ProductResolverPlugin {
48 // Imports foo.coco.bar, foo.ozar.bar, or foo.bar as appropriate
49 apply(resolver) {
50 resolver.ensureHook(this.target)
51
52 resolver
53 .getHook("undescribed-raw-file")
54 .tapAsync('ProductResolver', (request, ctx, cb) => {
55 cb()
56 })
57
58 resolver
59 .getHook("resolveStep")
60 .tap('ProductResolver', function(hook, request) {
61 if (/node_modules/.test(request.path)) return
62
63 if (!request.relativePath) return
64
65 if (/\.import\.(sass|scss)$/.test(request.path)) {
66 request.path = request.path.replace(/\.import\.(sass|scss)/, `.${productSuffix}.$1`)
67 return
68 }
69
70 let match = request.path.match(new RegExp(`([a-z]+)\\.${productSuffix}\\.\\1$`))
71 if (!match) return
72 let fixed = request.path.substr(0, match.index) + productSuffix + '.' + match[1]
73 request.path = fixed
74 })
75 }
76}
77
78// Main webpack config

Callers 15

wrapJasmineFunction · 0.80
setImmediate.jsFile · 0.80
checkRememberedGoalsFunction · 0.80
downTheChainFunction · 0.80
boot.jsFile · 0.80
fBoundFunction · 0.80
setUpBackboneMediatorFunction · 0.80
watchForErrorsFunction · 0.80
setUpIOSLoggingFunction · 0.80
teacherProxyRouteFunction · 0.80
loadFullStoryFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected