mix.js() output outside public folder
See original GitHub issue- Laravel Mix Version: 1.4.5
- Node Version: v8.6.0
- NPM Version: 5.3.0
- OS: Ubuntu 16.04
The below config creates public/mnt/www/resources/assets/js/dist
instead of placing .js files in resources/assets/js/dist
.
Would highly appreciate any help.
P.S. I need app.css
stay in public/css
webpack.mix.js:
let mix = require('laravel-mix');
mix.sass('resources/assets/sass/app.scss', 'public/css')
.js('resources/assets/js/app.js', '../resources/assets/js/dist')
.extract(['axios', 'vue'])
.version();
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
Laravel Mix with public folder outside the project folder
I have chosen to move the public folder outside the project root because I'm ... The mix.setPublicPath() is required to make sure the...
Read more >How can I change the public path to something containing an ...
How can I change the public directory where assets are compiled to? I have tried changing the paths within webpack.min.js to: mix.js('resources/ ...
Read more >The Mix API | Laravel Mix Documentation
Out of the box, Mix supports a wide array of frameworks and preprocessors. The methods below assume that you've imported mix at the...
Read more >How to use the laravel-mix.inProduction function in ... - Snyk
resolve("src/templates"), } // 🎚️ Misc mix.setPublicPath(config.publicFolder) mix.disableNotifications() mix.webpackConfig({ resolve: { alias: source } }) !
Read more >Hosting on shared servers | Web Applications in PHP
On shared hosting servers (e.g. sinners.be ), the default folder for your ... the output path for mix.js() to js and for mix.sass()...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found a workaround or maybe it’s the intended way to do this:
mix.setPublicPath('../static/dist')
helps with.js
and.sass
whereas.combine
and.copy
does not use the public path?This works for me:
@Lednerb Your method is working for me, but
Mix
can’t locatemix-manifest.json
file, because it’s still looking for it underpublic
directory.So, I used
mix.copy()
to copy it to original location:mix.setPublicPath('../static/dist').copy('../static/dist/mix-manifest.json', '../public/mix-manifest.json')