ben-rogerson / agency-webpack-mix-config

👨‍💻 A capable website/webapp boilerplate ready for the web agency battlefield. Creates a static site with Twig templating by default. Supports Craft/Wordpress/Laravel after a few adjustments.
104 stars 12 forks source link

Clarification on removing excess packages docs step #9

Closed alexljamin closed 5 years ago

alexljamin commented 5 years ago

@ben-rogerson In the section removing-excess-packages it is said to remove laravel-mix-twig-to-html among two other packages. Doing so will return the following error when running npm run dev or npm run start or npm run build:

internal/modules/cjs/loader.js:775
    throw err;
    ^

Error: Cannot find module 'laravel-mix-twig-to-html'
Require stack:
- /Users/<userName>/<projectName>/webpack.mix.js
- /Users/<userName>/<projectName>/node_modules/laravel-mix/setup/webpack.config.js
- /Users/<userName>/<projectName>/node_modules/webpack-cli/bin/utils/convert-argv.js
- /Users/<userName>/<projectName>/node_modules/webpack-dev-server/bin/webpack-dev-server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
    at Function.Module._load (internal/modules/cjs/loader.js:677:27)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at Object.<anonymous> (/Users/<userName>/<projectName>/webpack.mix.js:79:1)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at Object.<anonymous> (/Users/<userName>/<projectName>/node_modules/laravel-mix/setup/webpack.config.js:12:1)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/<userName>/<projectName>/webpack.mix.js',
    '/Users/<userName>/<projectName>/node_modules/laravel-mix/setup/webpack.config.js',
    '/Users/<userName>/<projectName>/node_modules/webpack-cli/bin/utils/convert-argv.js',
    '/Users/<userName>/<projectName>/node_modules/webpack-dev-server/bin/webpack-dev-server.js'
  ]
}

Perhaps the docs can be edited to reflect that.

Thanks

ben-rogerson commented 5 years ago

Hey Alek 👋 cheers for posting this issue - I've added a fix that'll avoid the error https://github.com/ben-rogerson/agency-webpack-mix-config/commit/6c222c779bb7dee9021e28dd6436bc2a909e6516