nodeart-components-loader
v2.1.56
Published
Angular 2 webpack loader that convert templates and styles paths in components if there are custom templates.
Downloads
64
Readme
Nodeart-Components-Loader
Angular 2 webpack loader that convert templates and styles paths in components if there are custom templates.
Tutorial
- In your webpack config file add path to custom templates and style folders. For getting path to project's root use app-root-path Example:
let appRoot = require('app-root-path');
let path = require('path');
let templatesPath = path.join(appRoot + '/src/@nodeart/templates');
let stylesPath = path.join(appRoot + '/src/@nodeart/styles');
- Install nodeart-components-loader from npm:
npm install --save nodeart-components-loader
- Add loader to webpack config file
test: /\.ts$/,
loaders: [
'nodeart-loader?templatesPath=' + templatesPath + '&stylesPath=' + stylesPath
]
- Create custom html template in your templates folder with the same origin template. Loader will change path.
- Finish