@@ -132,28 +132,54 @@ npm install --save-dev fs
132132
133133Replace the content of ` webpack.mix.fs `
134134``` bash
135- const mix = require( ' laravel-mix ' ) ;
136- var fs = require( ' fs ' ) ;
135+ var admin_path = ' resources/assets/vendor/vaahcms/admin/ ' ;
136+ var admin_default_theme_path = admin_path+ ' default/ ' ;
137137
138- /*
139- | --------------------------------------------------------------------------
140- | Mix Asset Management
141- | --------------------------------------------------------------------------
142- |
143- | Mix provides a clean, fluent API for defining some Webpack build steps
144- | for your Laravel application. By default, we are compiling the Sass
145- | file for the application as well as bundling up all the JS files.
146- |
147- * /
138+ mix.setPublicPath(admin_default_theme_path);
139+
140+ var admin_assets_json = JSON.parse(fs.readFileSync(admin_default_theme_path+' assets.json' ));
148141
149- var admin_assets_json = JSON.parse(fs.readFileSync( ' resources/assets/vendor/vaahcms/admin/default/assets.json ' ) );
142+ //console.log(admin_assets_json );
150143
151- console.log(admin_assets_json);
144+ var admin_copy_path = ' ./resources/assets/vendor/vaahcms/admin/' ;
145+ var admin_copy_path_des = ' ./packages/vaahcms/src/Resources/assets/admin/' ;
152146
153- mix.combine(admin_assets_json[' css' ], ' public/css/vaahcms-admin.css' )
154- .combine(admin_assets_json[' js' ], ' public/js/vaahcms-admin.js' )
147+ fs_extra.removeSync(admin_copy_path_des);
148+
149+ mix.combine(admin_assets_json[' css' ], admin_default_theme_path+' builds/vaahcms.css' )
150+ .combine(admin_assets_json[' js' ], admin_default_theme_path+' builds/vaahcms.js' )
151+ .js(admin_default_theme_path+' vue/app-setup.js' , ' ./builds' )
152+ .js(admin_default_theme_path+' vue/app-dashboard.js' , ' ./builds' )
153+ .js(admin_default_theme_path+' vue/app-modules.js' , ' ./builds' )
154+ .copyDirectory(admin_copy_path, admin_copy_path_des, false)
155155 .version ();
156156
157+
158+ //mix.copyDirectory(admin_copy_path, admin_copy_path_des, false);
159+
160+
161+ mix.webpackConfig({
162+ watchOptions: {
163+ aggregateTimeout: 2000,
164+ poll: 20,
165+ ignored: [
166+ ' /app/' ,
167+ ' /bootstrap/' ,
168+ ' /config/' ,
169+ ' /database/' ,
170+ ' /packages/' ,
171+ ' /public/' ,
172+ ' /routes/' ,
173+ ' /storage/' ,
174+ ' /tests/' ,
175+ ' /vaahcms/' ,
176+ ' /node_modules/' ,
177+ ' /vendor/' ,
178+
179+ ]
180+ }
181+ });
182+
157183```
158184
159185
0 commit comments