Skip to content

Commit

Permalink
chore: add optimization for snowpack build
Browse files Browse the repository at this point in the history
  • Loading branch information
deleonio committed Jan 31, 2021
1 parent 8750a13 commit 23d1da3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/stack/snowpack/src/snowpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ if (typeof packageJsonCli.version === 'string') {
MULTIPLE_REPLACEMENTS.push({ from: '$$CLI_VERSION$$', to: packageJsonCli.version });
}

// https://www.snowpack.dev/reference/configuration
module.exports = {
mount: {
public: '/',
Expand All @@ -56,4 +57,15 @@ module.exports = {
buildOptions: {
out: 'dist',
},
// https://www.snowpack.dev/guides/optimize-and-bundle#option-2%3A-optimize-plugins
optimize: {
// entrypoints: 'auto',
// preload: true,
// bundle: true, // https://github.com/snowpackjs/snowpack/discussions/2520
splitting: true,
treeshake: true,
manifest: true,
minify: true,
target: 'es2018',
},
};

0 comments on commit 23d1da3

Please sign in to comment.