[0.12.0] .scripts([input], output) in production environment outputs 'undefined'
See original GitHub issue- Laravel Mix Version: 0.12.0
- Node Version: 7.5.0
- NPM Version: 4.1.2
- OS: OS X El Capitan 10.11.6
Description:
Attempting to minify vanilla JS, without webpack. Running in dev environment works as expected, but production environment outputs ‘undefined’ for all javascript output files.
Steps To Reproduce:
Using the following files:
package.json
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.15.3",
"bootstrap-sass": "^3.3.7",
"cross-env": "^3.2.3",
"jquery": "^2.2.3",
"laravel-mix": "0.*",
"lodash": "^4.17.4",
"vue": "^1.0.26"
}
}
webpack.mix.js
mix.options({
processCssUrls: false,
});
mix.sass('resources/assets/sass/app.scss', 'public/css');
mix.scripts(['resources/assets/js/app.js'], 'public/js/app.js');
mix.scripts(['resources/assets/js/enquiry.js'], 'public/js/enquiry.js');
mix.scripts(['resources/assets/js/login.js'], 'public/js/login.js');
mix.scripts(['resources/assets/js/register.js'], 'public/js/register.js');
mix.scripts(['resources/assets/js/search.js'], 'public/js/search.js');
mix.scripts([
'node_modules/jquery/dist/jquery.js',
'node_modules/bootstrap-sass/assets/javascripts/bootstrap/collapse.js',
'node_modules/bootstrap-sass/assets/javascripts/bootstrap/dropdown.js',
'node_modules/bootstrap-sass/assets/javascripts/bootstrap/tab.js',
'node_modules/bootstrap-sass/assets/javascripts/bootstrap/transition.js',
], 'public/js/vendor.js');
mix.copyDirectory('resources/assets/fonts', 'public/fonts');
mix.copyDirectory('resources/assets/img', 'public/img');
npm run dev
: Outputs all files as expected. Sass, vanilla js (concatenated, unminified), etc.
npm run prod
: All js output files contain ‘undefined’.
I’ve downgraded to Laravel Mix 0.11.4, which has fixed my issues.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:7 (4 by maintainers)
Top Results From Across the Web
[0.12.0] .scripts([input], output) in production environment ...
Attempting to minify vanilla JS, without webpack. Running in dev environment works as expected, but production environment outputs 'undefined' ...
Read more >Automated Test Framework - How to solve "undefined...
Automated Test Framework - How to solve "undefined" as output of a ATF test step (Run server side script). Go to solution. lucascd....
Read more >Input Output Reference - EnergyPlus
1.1 What's different about EnergyPlus Input and Output? ... 1.7.30 Climate Group Outputs . ... C programs and Python scripts.
Read more >Why does declaring a variable in console produce undefined ...
The output you're seeing in the console is simply the printed value that your code resolved to. The statement doesn't resolve to a...
Read more >Interface Specifications - Nipype - Read the Docs
The OutputSpec defines the outputs that are generated, or possibly generated depending on inputs, by the tool. OutputSpecs inherit from interfaces.base.
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
Should be fixed by v0.12.1
I found the issue while using .babel, same solution resolved the issue.
Verified setting laravel-mix to 0.11.4 in package.json has it properly uglifying/outputting.