-
Notifications
You must be signed in to change notification settings - Fork 809
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
Help Test the 1.0 Release #860
Comments
Awesome 🔥 |
It worked fine based on the code block below. mix.js('resources/assets/js/app.js', 'public/js')
.copy('public/js/app.js', 'public/somewhere')
.combine([
'public/js/vendor/jquery.js',
'public/somewhere/app.js'
], 'public/all.js')
.version(); |
Slight issue : (updated)
Config :
|
I ran into some problems when using OS: Windows 10 Folder structure:
test-project/laravel/webpack.mix.js:
When I run test-project/public/mix-manifest.json:
I did some tests and found out that in here it tries to remove the I was able to find a way to make it kinda of work by using the function path.relative, I changed the return from:
to:
But I had to change Updated webpack.mix.js:
After doing this it seems to work fine. Sorry if my English is not very good. |
Windows 10 - 64bit My assets are generated "fine" but compilation end with 2 errors:
My admin/app.scss content: @import './bulma/bulma.sass';
@import './bootstrap.scss';
@import './alertify.scss';
@import './dropify.scss';
@import './highlighter.scss';
@import './typeahead.scss';
@import './chosen.css';
@import './flatpickr.css';
@import './lity.css'; |
@TopFuel Thanks! I'm on it. |
Has the process for using Mix outside of Laravel projects changed with the new beta? It would appear so. Keen to test this but I am not sure how to proceed given the changes in |
My compilation working fine now when I remove '.css' extension; Before: (error 3 comments above) @import './bulma/bulma.sass';
@import './bootstrap.scss';
@import './alertify.scss';
@import './dropify.scss';
@import './highlighter.scss';
@import './typeahead.scss';
@import './chosen.css';
@import './flatpickr.css';
@import './lity.css'; After: (working) @import './bulma/bulma.sass';
@import './bootstrap.scss';
@import './alertify.scss';
@import './dropify.scss';
@import './highlighter.scss';
@import './typeahead.scss';
@import './chosen';
@import './flatpickr';
@import './lity'; |
@natocTo Yeah, I've run into the same problem before, it seems to be a "problem" of the SASS compiler: |
On win10-x64. Just replaced the laravel-mix version using this Was working before, now no more. Thanks.
Got this error on React Compilation. webpack.mix.js
all of dependencies and devDependencies in package.json
|
On our pure Vue project we are using a check to HMR to copy some files, but now there's not if (!mix.config.options.hmr) {
mix.copyDirectory('src/assets', 'dist/src/assets')
} This causes this error now:
This is the script: "dev": "cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" |
@gabrielboliveira Try this way:
I do not know if it's the right way, Looking at the code in here it seems like |
cross-env was removed, however it is still used in the scripts section causing errors. |
Windows 10, Node 6.9.5, NPM 3.10.10, Yarn 0.21.3
package.json.txt |
@JeffreyWay is there a way to test if we can version only specific files in this version? I read in a couple of issues here that you'd add that functionality to 1.0. My current test versions all files.
|
@ruchern Thanks for the suggestion. I added the false variable, but I am still seeing a flattened directory structure. |
@edolyne Then I left with nothing for this problem. Guess wait for v1.0 release. |
@edolyne @ruchern It seems like the Api doesn't use/take the third param anymore.
|
I'm trying with an existing project and also from scratch.
When from scratch (using the instructions at the beginning of this issue)I'm getting the following error when trying to run and of the npm commands npm run dev [22:38:10]
> @ dev /Users/maxcarvalho/Code/test-project
> npm run development
> @ development /Users/maxcarvalho/Code/test-project
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
events.js:182
throw er; // Unhandled 'error' event
^
Error: spawn node_modules/webpack/bin/webpack.js ENOENT
at exports._errnoException (util.js:1016:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:189:19)
at onErrorNT (internal/child_process.js:366:16)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9)
at Function.Module.runMain (module.js:607:11)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/maxcarvalho/.npm/_logs/2017-06-15T21_38_17_040Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/maxcarvalho/.npm/_logs/2017-06-15T21_38_17_066Z-debug.log When I'm using with an existing project (non-laravel) I'm being able to run
|
Error with vue-video-player library
Try using css-load, style-loader, but it doesnt work
|
@iamgoodbytes - Yes, you can version specific files. Just pass a string or array of files to version (on top of what Webpack will automatically version), and you're all set. mix.version('public/some/file.js'); |
The updated code base feels a lot like fabpots approach with Encore. Everything seems to work together better. One project I'm working on has a lot of js... legacy modules, jquery plugins, scripts, etc. I struggled with mix for several days before trying Encore. I had it working in less than an hour. For me, the api just matched the way I think a little better. Now I'm anxious to pull mix back in and keep my frontend in the laravel family. Thanks for the untold hours of work you've put into this @JeffreyWay |
@JeffreyWay The problem I described above is still happening on the 1.0 release. |
@TopFuel I think it's best to create a new issue indeed, as this one's already closed... 🙂 |
@TopFuel You saved my day! My issue was just because Windows treats slashes differently comparing to Linux/Mac OS. See my following working code: let mix = require('laravel-mix');
let path = require('path');
mix.setPublicPath(`..${path.sep}public_html`);
mix.js('resources/assets/js/app.js', 'js')
.sass('resources/assets/sass/app.scss', 'css');
|
@renandiett I'm using this fix at the moment. |
Hey, everyone -
I've been working on Mix quite a bit in the last week, as we prep the official 1.0 release. Countless bugs have been fixed, and, for the non-webpack tasks, like concatenation, copying, and versioning, I've refactored the codebase to a more sequential task-based setup.
Because many sections of the codebase have been rewritten, I'd love some help testing the beta before we make it official.
Install
Currently, Laravel installs the 0.* version of Mix. Open
package.json
and delete that line entirely. We'll pull in the beta instead. Now return to the terminal and install Laravel's Node dependencies, as well as the beta of Laravel Mix.Okay, you're all set. Try out the API, see if you find any issues. I'm sure there are some, so we'll get those squared away pretty quickly and then officially release 1.0 soon.
What to Test
npm run watch
). This can sometimes get a little tricky.mix.options()
settings good?Notes
The API should be exactly the same. This isn't a breaking release.
File versioning (
mix.version()
) in Mix has changed. Rather than forcing a hash into the output file name, we instead store it as a querystring within yourmix-manifest.json
file. This not only simplifies the Mix codebase, but it should also make deployment and general compilation cleaner.Better terminal output for your compilation. This will now include even your non-webpack tasks.
If you create a .babelrc file in your project root, it'll now be intelligently merged with Mix's own Babel config file, rather than overwriting it completely. This was the source of many issues in the past.
Much of Mix's internal structure has been simplified and refactored to a plugin-based system.
mix.combine/scripts/styles/minify()
andmix.copy()
are now triggered sequentially, after webpack finishes its main compilation. This means, you can sequentially do thinks like:The text was updated successfully, but these errors were encountered: