Skip to content

Commit

Permalink
Upgrade to Laravel Mix 6 (#592)
Browse files Browse the repository at this point in the history
* Upgrade to Laravel Mix 6

* Move up public namespace, then remove namespace from Laravel Mix js asset definition.
  • Loading branch information
stephendolan authored Dec 31, 2020
1 parent 998fbab commit 00cf926
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
14 changes: 7 additions & 7 deletions src/browser_app_skeleton/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
},
"scripts": {
"heroku-postbuild": "yarn prod",
"dev": "yarn run webpack --progress --hide-modules --color --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "yarn run webpack --watch --hide-modules --color --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "NODE_ENV=production yarn run webpack --progress --hide-modules --color --config=node_modules/laravel-mix/setup/webpack.config.js"
"dev": "mix",
"watch": "mix watch",
"prod": "mix --production"
},
"devDependencies": {
"@babel/compat-data": "^7.9.0",
"browser-sync": "^2.26.7",
"compression-webpack-plugin": "^6.0.1",
"laravel-mix": "^5.0.5",
"compression-webpack-plugin": "^7.0.0",
"laravel-mix": "^6.0.0",
"postcss": "^8.1.0",
"resolve-url-loader": "^3.1.1",
"sass": "^1.26.10",
"sass-loader": "^10.0.2",
"vue-template-compiler": "^2.6.12"
"sass-loader": "^10.0.2"
}
}
11 changes: 5 additions & 6 deletions src/browser_app_skeleton/webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (mix.inProduction()) {
})
plugins.push(gzipCompression)

// Add additional compression plugins here.
// Add additional compression plugins here.
// For example if you want to add Brotli compression:
//
// let brotliCompression = new CompressionWepackPlugin({
Expand All @@ -40,13 +40,15 @@ if (mix.inProduction()) {
}

mix
// Set public path so manifest gets output here
.setPublicPath("public")
// JS entry file. Supports Vue, and uses Babel
//
// More info and options (like React support) here:
// https://github.com/JeffreyWay/laravel-mix/blob/master/docs/mixjs.md
.js("src/js/app.js", "public/js")
.js("src/js/app.js", "js")
// SASS entry file. Uses autoprefixer automatically.
.sass("src/css/app.scss", "public/css")
.sass("src/css/app.scss", "css")
// Customize postCSS:
// https://github.com/JeffreyWay/laravel-mix/blob/master/docs/css-preprocessors.md#postcss-plugins
.options({
Expand All @@ -56,8 +58,6 @@ mix
// Stops Mix from clearing the console when compilation succeeds
clearConsole: false
})
// Set public path so manifest gets output here
.setPublicPath("public")
// Add assets to the manifest
.version(["public/assets"])
// Reduce noise in Webpack output
Expand All @@ -73,7 +73,6 @@ mix

// Full API
// Docs: https://github.com/JeffreyWay/laravel-mix/tree/master/docs#readme
// Source: node_modules/laravel-mix/setup/webpack.mix.js
//
// mix.js(src, output);
// mix.react(src, output); <-- Identical to mix.js(), but registers React Babel compilation.
Expand Down

0 comments on commit 00cf926

Please sign in to comment.