I am trying to re-export an icon module which has 100+ svg icons in it which looks something like this:
This is a JavaScript file, would this cause the error below?
// This file is automatically generated
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var check = {
name: 'check',
data: '<svg>...</svg>'
}
exports.check = check
I then want to re-export that from my components module which I do like this:
export * as IconsModel from '@org/styles/icons/icon.model';
Then to use it I want to use it like this:
import { IconsModel as icons } from '@org/components/icons';
In my editor I get no errors, but when the code is built using webpack, I get the following error so I am not sure if the syntax is valid or not. If not what would be the correct syntax otherwise do I need an additional loader?
Module parse failed: Unexpected token (5:7)
File was processed with these loaders:
* ./node_modules/@skyux-sdk/istanbul-instrumenter-loader/dist/index.js
* ./node_modules/@storybook/angular/node_modules/ts-loader/index.js
* ./node_modules/@storybook/angular/dist/ts3.9/server/ngx-template-loader/index.js
You may need an additional loader to handle the result of these loaders.
> export*as IconsModel from'@org/styles/icons/icon.model';
@ ./stories/components/accordion/accordion.stories.ts 16:0-70 37:36-47
@ ./stories sync ^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(js|jsx|ts|tsx))$
@ ./generated-stories-entry.js
@ multi ./node_modules/@storybook/core-client/dist/esm/globals/polyfills.js