Preact and Webpack for production

Just trying to make sure that I configured my preact js correctly for production.

In my webpack setup with preact and running npm run, I notice that with the Bundle Analyzer Plugin, the path to the preact js file is

/node_modules/preact/dist/preact.js and not

/node_modules/preact/dist/preact.min.js

I have both guess and minimize js, but just thought it was curious that the minipack was not raised?

Script entry in web folder

  entry: { app: './src/index.js', vendor: [ 'preact', 'preact-router' ] },

Npm Run build script

   "build": "cross-env NODE_ENV=production webpack --progress -p --display-modules --display-chunks"

enter image description here

+4
source share
1 answer

main preact dist/preact.js - preact.min.js, , minification, (, , CDN), - .

UglifyJS , webpack -p, dist/preact.min.js. , . , (dist/preact.js), UglifyJS Preact, , ( ).

+4

Source: https://habr.com/ru/post/1667578/


All Articles