olsgreen / webpack-s3-pusher

Pushes your packed assets to your S3 compatible buckets, no more, no less.
MIT License
12 stars 5 forks source link

It's only uploading the main css and js #2

Open viotopo opened 3 years ago

viotopo commented 3 years ago

I have a quite long script which creates few css and js that I use differently depending on the page. The plugin works fine but it's not uploading the other css and js.

mix.js('resources/js/app.js', 'public/js') .postCss('resources/css/main.css', 'public/css', require('tailwindcss')) .scripts([ 'resources/js/viotopo/choices/choices.js', 'resources/js/viotopo/toastify/toastify.js', 'resources/js/viotopo/sweet-alert/sweet-alert.js', 'resources/js/common.js', 'resources/js/lang.js', ], 'public/js/common.js') .styles([ 'resources/css/viotopo/choices/choices.css', 'resources/css/viotopo/toastify/toastify.css', ],'public/css/common.css') .scripts([ 'resources/js/viotopo/filepond/filepond.js', 'resources/js/viotopo/filepond/filepond-plugin-image-preview.js', 'resources/js/viotopo/filepond/filepond-plugin-file-validate-type.js', 'resources/js/viotopo/filepond/filepond-plugin-file-validate-size.js', 'resources/js/viotopo/filepond/filepond-plugin-image-validate-size.js', 'resources/js/viotopo/filepond/filepond-plugin-image-crop.js', 'resources/js/viotopo/upload.js', ],'public/js/upload.js') .styles([ 'resources/css/viotopo/filepond/filepond.css', 'resources/css/viotopo/filepond/filepond-plugin-image-preview.css', ],'public/css/upload.css') .scripts([ 'resources/js/viotopo/maps/leaflet.js', 'resources/js/viotopo/maps/geosearch.umd.js', 'resources/js/viotopo/glide/glide.js', 'resources/js/viotopo/nouislider/nouislider.js', 'resources/js/viotopo/nouislider/wNumb.js', 'resources/js/helper.js', ],'public/js/helper.js');

It's uploading only the app.js and main.css, not the other 5 files.

any ideas?

olsgreen commented 3 years ago

Strange, it should upload the entire manifest.

Are all of the files to be uploaded listed in the summary after compilation?

viotopo commented 3 years ago

Yes they are listed, so weird...

On Sun, 4 Apr 2021, 14:01 Oliver Green, @.***> wrote:

Strange, it should upload the entire manifest.

Are all of the files to be uploaded listed in the summary after compilation?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/olsgreen/webpack-s3-pusher/issues/2#issuecomment-813013652, or unsubscribe https://github.com/notifications/unsubscribe-auth/APUBSLNQKG6L7HVHY3YKFVTTHBBJXANCNFSM42LFQTZQ .

viotopo commented 3 years ago

The whole mix-manifest.json:

{ "/js/app.js": "/js/app.js?id=3930f422743ecc448072", "/css/main.css": "/css/main.css?id=cfe6c2752efd97a7658f", "/js/common.js": "/js/common.js?id=8d91be9d35ba9fc1f449", "/js/logged.js": "/js/logged.js?id=374a18e39aa79f7d0922", "/css/common.css": "/css/common.css?id=320dad703070dcb9a455", "/js/upload.js": "/js/upload.js?id=2ed362a2403a22d01bdd", "/css/upload.css": "/css/upload.css?id=7b2353b078c92fc60e98", "/js/helper.js": "/js/helper.js?id=f028a4edde17b6731287", "/css/helper.css": "/css/helper.css?id=6d7ccc7ec546e22e21d7", "/js/admin.js": "/js/admin.js?id=8b975ac81b0f0660c183", "/js/charts.js": "/js/charts.js?id=13bb6d35e65968853a5c", "/css/admin.css": "/css/admin.css?id=922984f7d17740bb4923", "/js/admin-user.js": "/js/admin-user.js?id=0a2dcd1bcd4fed2010ed", "/css/admin-user.css": "/css/admin-user.css?id=7a8d15217ef475901433" }

olsgreen commented 3 years ago

Which version of Laravel mix are you using? (also node, npm, etc)

viotopo commented 3 years ago

Laravel mix: 5.0.7 node: v14.2.0 npm: 6.14.5

viotopo commented 3 years ago

More information, I put console.log to see what is in compilation:

S3PusherPlugin.prototype.apply = function(compiler) { compiler.hooks.emit.tapAsync("S3PusherPlugin", (compilation, callback) => { console.log(compilation); for (var filename in compilation.assets) { if (this.shouldUpload(filename)) { this.assets.push(filename); } }

callback();

});

Only 1 js file while on my screen I can see: DONE Compiled successfully in 21433ms 17:27:56

                                              Asset      Size  Chunks             Chunk Names
                                /css/admin-user.css  2.39 KiB       0  [emitted]  /js/app
                                     /css/admin.css  2.98 KiB       0  [emitted]  /js/app
                                    /css/common.css  7.62 KiB       0  [emitted]  /js/app
                                    /css/helper.css  33.1 KiB       0  [emitted]  /js/app
                                      /css/main.css  69.3 KiB       0  [emitted]  /js/app
                                    /css/upload.css  19.1 KiB       0  [emitted]  /js/app
                                  /js/admin-user.js  35.6 KiB          [emitted]  
                                       /js/admin.js   204 KiB          [emitted]  
                                         /js/app.js  36.1 KiB       0  [emitted]  /js/app
                                      /js/charts.js   169 KiB          [emitted]  
                                      /js/common.js   149 KiB          [emitted]  
                                      /js/helper.js   222 KiB          [emitted]  
                                      /js/logged.js  8.18 KiB          [emitted]  
                                      /js/upload.js   150 KiB          [emitted]  

Definitely there is an issue because I have tried all the possible combinations, combine, minify, scripts, and none of them works, only the main js.