ng2-ckeditor icon indicating copy to clipboard operation
ng2-ckeditor copied to clipboard

Cannot find the bundled JS file in the package

Open ghc20 opened this issue 4 years ago • 3 comments

Cannot find the bundled lib/index.js in the installed package through npm install ng2-ckeditor . Here is the package structure:

image

ghc20 avatar Apr 14 '22 18:04 ghc20

If you are working with angular framework you don't need lib/index.js file. Please check the demo project on stackblitz and create your own example on stackblitz environment.

kzimny avatar Apr 15 '22 06:04 kzimny

@kzimny , what config should be set in SystemJS config? We are using SystemJS to load and compile our Angular app. Here is our current config:

System.config({
  map: {
    'ng2-ckeditor': 'npm:ng2-ckeditor'
  },
  packages: {
    'ng2-ckeditor': {
      main: 'bundles/ng2-ckeditor.umd.js',
      defaultExtension: 'js'
    },
  },
});

ghc20 avatar Apr 19 '22 15:04 ghc20

When modules are flagged as ECMAScript modules, the Node runtime uses a different pattern or method for resolving file imports. Read the following description. Try to import as follow (not tested):

System.config({
  map: {
    'ng2-ckeditor': 'npm:ng2-ckeditor'
  },
  packages: {
    'ng2-ckeditor': {
      main: 'esm2020/index.mjs',
      defaultExtension: 'mjs'
    },
  },
});

kzimny avatar Apr 24 '22 10:04 kzimny