vue-cli-plugin-tailwind
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -0,2 +1,33 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
function loadModule(src, filename) { | ||
var Module = module.constructor; | ||
var m = new Module(); | ||
m._compile(src, filename); | ||
return m.exports; | ||
} | ||
function readPostcssConfig(generator) { | ||
const filename = 'postcss.config.js'; | ||
const file = generator.files[filename]; | ||
if (file) { | ||
const filePath = path.join(generator.context, filename); | ||
fs.writeFileSync(filePath, ''); | ||
return loadModule(file, filename); | ||
} | ||
const config = generator.originalPkg.postcss; | ||
if (config) { | ||
const copy = { ...config }; | ||
delete config.plugins; | ||
return copy; | ||
} | ||
return {}; | ||
} | ||
module.exports = (api, options) => { | ||
const postcss = readPostcssConfig(api.generator); | ||
const configs = { | ||
@@ -10,9 +41,5 @@ postcss: { | ||
}; | ||
api.addConfigTransform('postcss', { | ||
file: { | ||
js: ['postcss.config.js'], | ||
json: ['.postcssrc.json', '.postcssrc'], | ||
yaml: ['.postcssrc.yaml', '.postcssrc.yml'], | ||
}, | ||
}); | ||
configs.postcss.plugins = { ...configs.postcss.plugins, ...postcss.plugins }; | ||
api.extendPackage(configs); | ||
@@ -19,0 +46,0 @@ |
{ | ||
"name": "vue-cli-plugin-tailwind", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "vue-cli plugin for Tailwind CSS", | ||
@@ -5,0 +5,0 @@ "author": "Jens Eggerstedt <j.eggerstedt@kaibatech.de>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5231
123
1