Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

path is not defined when using mix.webpackConfig #503

Closed
Faisal0sal opened this issue Mar 1, 2017 · 1 comment
Closed

path is not defined when using mix.webpackConfig #503

Faisal0sal opened this issue Mar 1, 2017 · 1 comment

Comments

@Faisal0sal
Copy link

Faisal0sal commented Mar 1, 2017

I have :

  1. Updated Laravel Mix to the latest version.
  2. Nuke my dependencies, and reinstall from scratch: rm -rf node_modules && npm install.
  3. Checked my package.json file, and ensure that there are no old Laravel Elixir dependencies that might be interfering with Mix.
  • Laravel Mix Version: 0.8.8
  • Node Version (7.5.0):
  • NPM Version (4.1.2):
  • OS:

Description:

Trying to merge web configuration using the example:

mix.webpackConfig({
    resolve: {
        modules: [
            path.resolve(__dirname, 'vendor/laravel/spark/resources/assets/js')
        ]
    }
});

Running npm run dev will get me an error of:

            path.resolve(__dirname, 'vendor/laravel/spark/resources/assets/js')
            ^

ReferenceError: path is not defined
@JeffreyWay
Copy link
Collaborator

Add

var path = require('path');

to the top of your webpack.mix.js file.

PDXfoster added a commit to PDXfoster/laravel-mix that referenced this issue Jul 22, 2021
As noted in issue laravel-mix#503, it might behelpful to include the need to define the path more explicitly in the documentation 
laravel-mix#503
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants