Gathering detailed insights and metrics for autoimport-ngtemplate-loader
Gathering detailed insights and metrics for autoimport-ngtemplate-loader
Gathering detailed insights and metrics for autoimport-ngtemplate-loader
Gathering detailed insights and metrics for autoimport-ngtemplate-loader
Auto require AngularJS 1.x templates in Webpack style
npm install autoimport-ngtemplate-loader
Typescript
Module System
Min. Node Version
Node Version
NPM Version
62.6
Supply Chain
89.6
Quality
73.4
Maintenance
25
Vulnerability
99.3
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
95 Commits
1 Watchers
3 Branches
1 Contributors
Updated on Dec 15, 2017
Latest Version
1.1.2
Package Id
autoimport-ngtemplate-loader@1.1.2
Size
4.03 kB
NPM Version
5.6.0
Node Version
8.9.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
2
Auto require AngularJS 1.x templates in Webpack style
Install the package by running npm install autoimport-ngtemplate-loader
. Once installed, you can add it to your Webpack config.
1module.exports = { 2 module: { 3 rules: [ 4 { 5 test: /\.js$/, 6 exclude: /node_modules/, 7 use: ['babel-loader', 'other-loaders', 'autoimport-ngtemplate-loader'] 8 } 9 ] 10 } 11};
Note - It is recommended that this loader be run before any transpilation happens so it can operate on unchanged source code.
The next step is to add ngtemplate-loader
and a loader that you want to handle your template code with. The most common one is html-loader
. This will run every time Webpack encounters require('something.html')
.
1module.exports = { 2 module: { 3 rules: [ 4 { 5 test: /\.html$/, 6 exclude: /node_modules/, 7 use: [ 8 { 9 loader: 'ngtemplate-loader', 10 options: { 11 relativeTo: 'src/' 12 } 13 }, 14 { 15 loader: 'html-loader' 16 } 17 ] 18 } 19 ] 20 } 21}
It is a good idea to add the relativeTo
option for ngtemplate-loader
so that the templates aren't put into the Angular template cache with absolute paths which contain platform specific or user specific information. This will affect the portability of the bundled code.
This module supports configuration through either the options
object method or the query string method. The valid options are listed in the table below.
Name | Type | Default Value | Details |
---|---|---|---|
variableName | string | autoImportNgTemplateLoaderTemplate | The variable name that gets injected into the compiled code. This is included so that variable collisions can be prevented. |
Once the repository is cloned, run npm install
to get all the dependencies. The examples in this package also depend on ngtemplate-loader
and html-loader
. Those are declared as peer dependencies of this package so they need to be installed with npm install ngtemplate-loader html-loader
.
If you're using a npm v5, you will need to include the --no-save
flag so that they don't get added to the package dependencies.
There are two example projects includes. One that has one directive and another that has more. You can run npm run one-directive
, npm run many-directives
or npm run multiple-directives
to see the loader in action. Once successful, examining the build/bundle.js
file will show the results.
The tests for this package are written in with ava. They can be run by running npm test
.
This project uses ESLint. All the requisite files can be linted using npm run linter
. The rules for this project are located in eslintrc.json
.
This project also includes an .nvmrc
. This is to tell nvm
what version of Node.js to use for this project. It is set to v6.10.3 which is the current LTS release. However, any Node.js version greater than v6.10.3 should also work.
The project is also compatible with yarn
, Facebook's package manager. Normal yarn
commands apply.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
78 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More