ctf0 / laravel-mix-versionhash

Auto append hash to file instead of using virtual one
MIT License
61 stars 18 forks source link

Error: Path variable [contenthash:6] not implemented in this context #13

Closed jordanade closed 5 years ago

jordanade commented 5 years ago

Trying to use this with the new laravel-mix 4.

 92% additional asset processing ExtractTextPlugin/Users/jordan/Projects/jottful/node_modules/webpack/lib/TemplatedPathPlugin.js:43
                throw new Error(
                ^

Error: Path variable [contenthash:6] not implemented in this context: /css/producer.[contenthash:6].css
    at fn (/Users/jordan/Projects/jottful/node_modules/webpack/lib/TemplatedPathPlugin.js:43:11)
    at fn (/Users/jordan/Projects/jottful/node_modules/webpack/lib/TemplatedPathPlugin.js:31:16)
    at String.replace (<anonymous>)
    at replacePathVariables (/Users/jordan/Projects/jottful/node_modules/webpack/lib/TemplatedPathPlugin.js:99:5)
    at SyncWaterfallHook.eval [as call] (eval at create (/Users/jordan/Projects/jottful/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)
    at MainTemplate.getAssetPath (/Users/jordan/Projects/jottful/node_modules/webpack/lib/MainTemplate.js:508:31)
    at Compilation.getPath (/Users/jordan/Projects/jottful/node_modules/webpack/lib/Compilation.js:2476:28)
    at getPath (/Users/jordan/Projects/jottful/node_modules/extract-text-webpack-plugin/dist/index.js:315:51)
    at ExtractTextPlugin.extractedChunks.forEach.extractedChunk (/Users/jordan/Projects/jottful/node_modules/extract-text-webpack-plugin/dist/index.js:323:83)
    at Array.forEach (<anonymous>)
    at compilation.hooks.additionalAssets.tapAsync.assetCb (/Users/jordan/Projects/jottful/node_modules/extract-text-webpack-plugin/dist/index.js:301:25)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/jordan/Projects/jottful/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:12:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/jordan/Projects/jottful/node_modules/tapable/lib/Hook.js:154:20)
    at hooks.optimizeTree.callAsync.err (/Users/jordan/Projects/jottful/node_modules/webpack/lib/Compilation.js:1305:32)
    at _err7 (eval at create (/Users/jordan/Projects/jottful/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:65:1)
    at _async2.default.forEach.err (/Users/jordan/Projects/jottful/node_modules/extract-text-webpack-plugin/dist/index.js:296:11)
    at /Users/jordan/Projects/jottful/node_modules/async/dist/async.js:473:16
    at iteratorCallback (/Users/jordan/Projects/jottful/node_modules/async/dist/async.js:1064:13)
    at /Users/jordan/Projects/jottful/node_modules/async/dist/async.js:969:16
    at _async2.default.forEach.err (/Users/jordan/Projects/jottful/node_modules/extract-text-webpack-plugin/dist/index.js:274:13)
    at /Users/jordan/Projects/jottful/node_modules/async/dist/async.js:473:16
    at iteratorCallback (/Users/jordan/Projects/jottful/node_modules/async/dist/async.js:1064:13)
    at /Users/jordan/Projects/jottful/node_modules/async/dist/async.js:969:16
    at compilation.rebuildModule.err (/Users/jordan/Projects/jottful/node_modules/extract-text-webpack-plugin/dist/index.js:261:26)
    at callback (/Users/jordan/Projects/jottful/node_modules/webpack/lib/Compilation.js:1131:5)
    at processModuleDependencies.err (/Users/jordan/Projects/jottful/node_modules/webpack/lib/Compilation.js:1154:5)
    at process._tickCallback (internal/process/next_tick.js:61:11)
ctf0 commented 5 years ago

please manually try this fix and reply back https://github.com/ctf0/laravel-mix-versionhash/pull/12/files

ghost commented 5 years ago

@ctf0 it works.

ctf0 commented 5 years ago

@maaxxicarvalho thanx, i'll publish a new version with the fix today

omarkhatibco commented 5 years ago

Hi @ctf0 I mean here , can you publish it to NPM ?

ctf0 commented 5 years ago

@omarkhatibco i was waiting for more testers, anyway new version is released, if you found any problems plz open a new issue.

omarkhatibco commented 5 years ago

@ctf0 Thanks !