Answer the question
In order to leave comments, you need to log in
How to make two mix-manifest.json?
I collect resources for two sites with one yarn command. In webpack.mix.js, the config is something like this:
const mixCommon = require('laravel-mix');
const mixLanding = require('laravel-mix');
//Конфиг для основного сайта ----------------------------------------------------------------------
mixCommon.sass('frontend/assets/src/sass/common.scss', 'frontend/web/css')
.options({
imgLoaderOptions: {enabled: false},
postCss: [
require('postcss-css-variables')()
]
})
.version();
mixCommon.setPublicPath('frontend/web/');
//Тут собираем файлы для лэндинга -------------------------------------------------------------
mixLanding.sass('landing/assets/src/sass/landing.scss', 'landing/web/css')
.options({
imgLoaderOptions: {enabled: false},
postCss: [
require('postcss-css-variables')()
]
})
.version();
mixLanding.setPublicPath('landing/web/');
landing/web/
, also contains records about common resources. Can you tell me how to share it correctly? I do not get you. Only split into two teams? In principle, it does not ask to eat, because. further, the asset manager still publishes only what is needed for everyone, but somehow it is an eyesore.
Answer the question
In order to leave comments, you need to log in
In general, yes. Only division into two teams.
In package.json:
"scripts": {
"production-front": "cross-env process.env.section=front NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"production-admin": "cross-env process.env.section=admin NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
let mix = require('laravel-mix');
if (process.env.section) {
require(__dirname + '/webpack.mix.' + process.env.section + '.js');
}
webpack.mix.front.js
andwebpack.mix.admin.js
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question