diff --git a/gulpfile.js b/gulpfile.js index 142c0ca4..37f57778 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -16,6 +16,9 @@ const onError = (error) => { const sassOptions = {style: 'compressed'}; +//cief todo: gulp +const ASSET_URL = process.env.ASSET_URL; + gulp.task('vendorJs', () => { fancyLog('Compiling vendor JS dependencies'); @@ -37,6 +40,7 @@ gulp.task('vendorCss', () => { .pipe(plugins.cleanCss()) .pipe(plugins.replace('../../../font-awesome/', './')) .pipe(plugins.replace('../../jquery-ui-dist/', '')) + .pipe(plugins.replace(/background-image:url\(\.\.\/\.\.\//g, `background-image:url(${ASSET_URL}`)) //cief todo: gulp .pipe(gulp.dest(pkg.paths.build.css)); }); @@ -115,4 +119,4 @@ gulp.task('watch', (done) => { gulp.watch(pkg.globs.sourceJs, gulp.series('sourceJs')); gulp.watch(pkg.globs.sourceJs, gulp.series('sourceFonts')); done(); -}); \ No newline at end of file +}); diff --git a/webpack.mix.js b/webpack.mix.js index 59d5e97a..87b6d17c 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -12,3 +12,21 @@ const mix = require('laravel-mix'); */ mix.js('./resources/assets/vue/app.js', 'public/vue').version(); + +//cief todo: gulp +// if (mix.inProduction()) { + const ASSET_URL = process.env.ASSET_URL; + + mix.webpackConfig(webpack => { + return { + plugins: [ + new webpack.DefinePlugin({ + "process.env.ASSET_PATH": JSON.stringify(ASSET_URL) + }) + ], + output: { + publicPath: ASSET_URL + } + }; + }); +// }