Created
September 25, 2019 16:04
-
-
Save Gkiokan/835fa9cfd1726a3e68eb48a9141fe6b2 to your computer and use it in GitHub Desktop.
Laravel Mix Webpack configuration alias and chunkFile configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mix = require('laravel-mix'); | |
require('laravel-mix-merge-manifest'); | |
const VuetifyLoaderPlugin = require('vuetify-loader/lib/plugin'); | |
mix.setPublicPath('../../public').mergeManifest(); | |
mix.js(__dirname + '/Resources/assets/src/main.js', 'modules/web/app.js') | |
.sass( __dirname + '/Resources/assets/sass/app.scss', 'modules/web/app.css'); | |
// mix.js(__dirname + '/res/src/main.js', 'modules/web/app.js') | |
// .sass( __dirname + '/Resources/assets/sass/app.scss', 'modules/web/app.css'); | |
if (mix.inProduction()) { | |
mix.version(); | |
} | |
mix.webpackConfig({ | |
plugins: [ | |
// new BundleAnalyzerPlugin(), | |
// new CleanWebpackPlugin({ | |
// cleanStaleWebpackAssets: false, | |
// cleanOnceBeforeBuildPatterns: ['pulblic/css/*', 'public/js/*'], | |
// }), | |
new VuetifyLoaderPlugin(), | |
], | |
resolve: { | |
extensions: ['.js', '.json', '.vue'], | |
alias: { | |
// 'vue$': 'vue/dist/vue.esm.js', | |
'~': path.join(__dirname, '/Resources/assets/src'), | |
} | |
}, | |
output: { | |
chunkFilename: 'modules/web/js/[name].[chunkhash].js', | |
publicPath: '/' // mix.config.hmr ? '//localhost:8080' : '/' | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment