Gathering detailed insights and metrics for rollup-plugin-postcss-webpack-alias-less-loader
Gathering detailed insights and metrics for rollup-plugin-postcss-webpack-alias-less-loader
Gathering detailed insights and metrics for rollup-plugin-postcss-webpack-alias-less-loader
Gathering detailed insights and metrics for rollup-plugin-postcss-webpack-alias-less-loader
npm install rollup-plugin-postcss-webpack-alias-less-loader
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
2 Stars
5 Commits
1 Forks
2 Watching
2 Branches
1 Contributors
Updated on 26 Jun 2023
JavaScript (85.3%)
Shell (8.26%)
CSS (6.44%)
Cumulative downloads
Total Downloads
Last day
-37.8%
56
Compared to previous day
Last week
-25.8%
270
Compared to previous week
Last month
8.8%
1,292
Compared to previous month
Last year
90.7%
17,898
Compared to previous year
This is a custom loader for Rollup Plugin Postcss that allows users to define webpack style aliases and have them resolve.
ex:
1@import "~bootstrap/less/common.less"; 2@import "~myAlias";
see: rollupPostcssLessLoader for full docs
~
will get resolved to node_modules
by default but is overridable.
usage below is a complete example that is used along side webpack to generate cjs and es modules:
1const alias = require('rollup-plugin-alias'); 2// Cant use rollup-plugin-typescript until the following issue is resolved, rollup-plugin-typescript2 is slow, but works :( 3// https://github.com/rollup/rollup-plugin-typescript/issues/109 4// const typescript = require('rollup-plugin-typescript'); 5const typescript = require('rollup-plugin-typescript2'); 6const postcss = require('rollup-plugin-postcss'); 7const path = require('path'); 8const { minify } = require('html-minifier'); 9const external = require('@yelo/rollup-node-external'); 10const rollupPostcssLessLoader = require('rollup-plugin-postcss-webpack-alias-less-loader') 11 12// Slurp in the webpack config so we don't have to duplicate aliases. 13const webpackConfig = require('./webpack.config'); 14 15const aliases = webpackConfig.resolve.alias; 16 17const NODE_MODULE_PATH = path.resolve('../../../../node_modules'); 18 19const CONFIG = { 20 external: external({ 21 modulesDir: NODE_MODULE_PATH, 22 }), 23 input: [webpackConfig.entry.lib], 24 output: { name: 'core', file: 'lib/lib.es.js', format: 'es', sourcemap: true }, 25 treeshake: true, 26 plugins: [ 27 { 28 // LOGGING PLUGIN 29 transform(code, id) { 30 console.log(`Processing: '${id}'`); 31 }, 32 }, 33 alias({ 34 resolve: ['.ts', '.tsx', '/index.ts', '/index.tsx'], 35 ...aliases, 36 }), 37 typescript({ 38 check: false, 39 }), 40 postcss({ 41 loaders: [rollupPostcssLessLoader({ 42 nodeModulePath: NODE_MODULE_PATH, 43 aliases: aliases 44 })], 45 }), 46 { 47 // HTML TEMPLATE PLUGIN 48 transform(code, id) { 49 if (id.endsWith('.html')) { 50 return { 51 code: `export default ${JSON.stringify(minify(code, {}))}`, 52 map: { mappings: '' }, 53 }; 54 } 55 }, 56 }, 57 ], 58}; 59 60module.exports = { 61 default: CONFIG, 62};
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/5 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
70 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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