Angular
To use OneSDK with Angular, you need to configure your build tool to process SVG, CSS and path alias.
If you use webpack, please use https://webpack.js.org/loaders/ to install required loaders and configure the corresponding settings.
Webpack's official documentation provides sufficient coverage for these scenarios.
For your convenience, the relevant links are provided below:
If you use webpack v5:
- https://webpack.js.org/loaders/css-loader to support CSS
- https://webpack.js.org/guides/asset-modules/ to support SVG and fonts
- https://webpack.js.org/configuration/resolve/ to support alias path
If you use webpack v4 or below:
- https://v4.webpack.js.org/loaders/style-loader/ to support CSS
- https://v4.webpack.js.org/loaders/svg-inline-loader/ to support SVG
- https://v4.webpack.js.org/loaders/file-loader/ to support fonts
- https://v4.webpack.js.org/configuration/resolve/ to support path alias
Adding CSS Loader and Asset Modules using Custom-Webpack in an Angular Project
-
Install Custom-Webpack Package:
- Run the following command in your terminal:
npm install @angular-builders/custom-webpack
- Run the following command in your terminal:
-
Modify
tsconfig.json
:- Open your
tsconfig.json
file. - Add the following line to the compiler options section:
"skipLibCheck": true
- Open your
-
Utilize Custom-Webpack:
Ensure your project is configured to use custom-webpack for modifying Angular's webpack configuration. Follow the custom-webpack documentation for detailed steps if needed.
Updated 2 months ago