fusion-cli icon indicating copy to clipboard operation
fusion-cli copied to clipboard

JSON tree shaking is not supported

Open flyingsky opened this issue 6 years ago • 1 comments

Type of issue

bug

Description

Add import {version} from '../package.json' to get version from package.json and use it, but whole package.json is included in js bundle. Same code without fusion only version is imported and tree shaking works well.

Current behavior

Whole json file is included in js bundle.

Expected behavior

Only imported property should be imported.

Steps to reproduce

  1. Add import {version} from '../package.json' to your code and use it.
  2. yarn build-production the whole json file is included in js bundle.

Your environment

  • fusion-cli version: 1.9.1

  • Node.js version (node --version): 8.11.3

  • npm version (npm --version): 5.6.0

  • Operating System: Mac

flyingsky avatar Sep 05 '18 18:09 flyingsky

I think this is technically a breaking change. This will be supported in the next major fusion-cli version.

See: https://github.com/fusionjs/fusion-cli/pull/509

rtsao avatar Sep 12 '18 20:09 rtsao