Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Help with setup for chunks #1

Open
tanthammar opened this issue Nov 13, 2019 · 0 comments
Open

Help with setup for chunks #1

tanthammar opened this issue Nov 13, 2019 · 0 comments

Comments

@tanthammar
Copy link

tanthammar commented Nov 13, 2019

Thank you for making this package !!
Webpack is really not my forte :)

Can you help me with a setting that will process the chunked files generated from my current setup?

My Laravel webpack.mix.js looks like this, and with the default setting only app.js is compiled w brotli.

const cssImport = require('postcss-import')
const cssNesting = require('postcss-nesting')
const mix = require('laravel-mix')
const path = require('path')
const tailwindcss = require('tailwindcss')

require('laravel-mix-brotli')

mix.js('resources/js/app.js', 'public/js')
  .postCss('resources/css/app.css', 'public/css', [
    cssImport(),
    cssNesting(),
    tailwindcss('tailwind.js'),
  ])
  .webpackConfig({
    output: { chunkFilename: 'js/[name].js?id=[chunkhash]' },
    resolve: {
      alias: {
        'vue$': 'vue/dist/vue.runtime.esm.js',
        '@': path.resolve('resources/js'),
      },
    },
  })
  .babelConfig({
    plugins: ['@babel/plugin-syntax-dynamic-import'],
  })
  .version()
  .sourceMaps()
  .brotli()

Output

                               Asset      Size  Chunks                                Chunk Names
                        /css/app.css  1.46 MiB      15  [emitted]              [big]  /js/app
                     /css/app.css.br  58.4 KiB          [emitted]                     
                          /js/app.js   123 KiB      15  [emitted]                     /js/app
                       /js/app.js.br  36.5 KiB          [emitted
                      /js/app.js.map   577 KiB      15  [emitted] [dev]               /js/app
 js/0.js.map?id=6a608aca30aa79995860   124 KiB       0  [emitted] [dev]               
     js/0.js?id=6a608aca30aa79995860  21.2 KiB       0  [emitted] [immutable]         
 js/1.js.map?id=180d034d972d5376fe31  54.2 KiB       1  [emitted] [dev]               
     js/1.js?id=180d034d972d5376fe31  18.3 KiB       1  [emitted] [immutable]         
js/10.js.map?id=41b2c0daa2c467d27d33  17.9 KiB      10  [emitted] [dev]               
    js/10.js?id=41b2c0daa2c467d27d33  5.78 KiB      10  [emitted] [immutable]         
js/11.js.map?id=a350ed8076c4087415ee  21.3 KiB      11  [emitted] [dev]               
    js/11.js?id=a350ed8076c4087415ee  6.88 KiB      11  [emitted] [immutable]         
js/12.js.map?id=91f1919cf92bd62d9a9a  15.7 KiB      12  [emitted] [dev]               
    js/12.js?id=91f1919cf92bd62d9a9a  4.87 KiB      12  [emitted] [immutable]         
js/13.js.map?id=657fe61b531e6254ec75  12.7 KiB      13  [emitted] [dev]               
    js/13.js?id=657fe61b531e6254ec75  4.15 KiB      13  [emitted] [immutable]         
js/14.js.map?id=839a8fb7cf008ee79760  10.5 KiB      14  [emitted] [dev]               
    js/14.js?id=839a8fb7cf008ee79760  3.43 KiB      14  [emitted] [immutable]         
 js/2.js.map?id=4419e4465b1f69ebfa9e   672 KiB       2  [emitted] [dev]               
     js/2.js?id=4419e4465b1f69ebfa9e  69.6 KiB       2  [emitted] [immutable]         
 js/3.js.map?id=863849265d1386d82aef  65.1 KiB       3  [emitted] [dev]               
     js/3.js?id=863849265d1386d82aef    22 KiB       3  [emitted] [immutable]         
 js/4.js.map?id=efd0a7de4abcd52aab91  64.2 KiB       4  [emitted] [dev]               
     js/4.js?id=efd0a7de4abcd52aab91  21.7 KiB       4  [emitted] [immutable]         
 js/5.js.map?id=cfeb77eed48936723950  62.5 KiB       5  [emitted] [dev]               
     js/5.js?id=cfeb77eed48936723950  21.5 KiB       5  [emitted] [immutable]         
 js/6.js.map?id=ff7eb9b36019f316085f    22 KiB       6  [emitted] [dev]               
     js/6.js?id=ff7eb9b36019f316085f  7.52 KiB       6  [emitted] [immutable]         
 js/7.js.map?id=7db7b7b3f7d61213c730  47.2 KiB       7  [emitted] [dev]               
     js/7.js?id=7db7b7b3f7d61213c730  16.6 KiB       7  [emitted] [immutable]         
 js/8.js.map?id=12033816df1fefe9f082  45.9 KiB       8  [emitted] [dev]               
     js/8.js?id=12033816df1fefe9f082  16.2 KiB       8  [emitted] [immutable]         
 js/9.js.map?id=937bba9847f7a31e5c6f  21.5 KiB       9  [emitted] [dev]               
     js/9.js?id=937bba9847f7a31e5c6f  6.65 KiB       9  [emitted] [immutable]     
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant