vue-cli-plugin-vuestic-ui
Advanced tools
Comparing version 1.0.9 to 1.0.10
module.exports = { | ||
importStrings: [ | ||
"import { createVuestic } from 'vuestic-ui'", | ||
"import 'vuestic-ui/css'", | ||
], | ||
css: [ | ||
'vuestic-ui/css', | ||
], | ||
extendPackage: { | ||
dependencies: { | ||
'vuestic-ui': '^1.4.10', | ||
'vuestic-ui': '^1.5.0', | ||
} | ||
@@ -10,0 +12,0 @@ }, |
module.exports = { | ||
importStrings: (answers) => { | ||
importStrings: [ | ||
"import { createVuesticEssential, VaButton } from 'vuestic-ui'" | ||
], | ||
css: (answers) => { | ||
const strings = [ | ||
"import { createVuesticEssential, VaButton } from 'vuestic-ui'", | ||
"import 'vuestic-ui/styles/essential.css'", | ||
'vuestic-ui/styles/essential.css', | ||
] | ||
if (answers.treeshakingOptions.includes('grid')) { | ||
strings.push("import 'vuestic-ui/styles/grid.css'") | ||
strings.push('vuestic-ui/styles/grid.css') | ||
} | ||
if (answers.treeshakingOptions.includes('normalize')) { | ||
strings.push("import 'vuestic-ui/styles/reset.css'") | ||
strings.push('vuestic-ui/styles/reset.css') | ||
} | ||
if (answers.treeshakingOptions.includes('typography')) { | ||
strings.push("import 'vuestic-ui/styles/typography.css'") | ||
strings.push('vuestic-ui/styles/typography.css') | ||
} | ||
@@ -19,0 +21,0 @@ |
@@ -5,2 +5,3 @@ const fs = require('fs') | ||
const insertVuesticPlugin = require('./utils/insertPlugin') | ||
const insertCssImports = require('./utils/insertCssImports') | ||
const configs = require('./configs') | ||
@@ -13,11 +14,5 @@ const executeIfFunction = require('./utils/executeIfFunction') | ||
if (resolveDependency('vite')) { | ||
const normalize = answers.treeshakingOptions ? answers.treeshakingOptions.includes('normalize') : true | ||
const typescript = resolveDependency('typescript') | ||
// Adds rollup alias to resolve normalize.css | ||
api.render({ | ||
'./index.html': './templates/vite/index.html', | ||
[`./vite.config.${typescript ? 'ts' : 'js'}`]: './templates/vite/vite.config.ejs' | ||
}, | ||
{ normalize } | ||
} | ||
) | ||
@@ -53,4 +48,10 @@ } else { | ||
.reduce((l, pluginName) => insertVuesticPlugin(l, pluginName), lines) | ||
fs.writeFileSync(api.resolve(api.entryFile), linesWithVuesticPlugin.join(EOL), { encoding: 'utf-8' }) | ||
const css = executeIfFunction(config.css, answers) | ||
// For some reason css imports like `import 'style.css'` do not work with importStrings | ||
// So we need to insert them manually | ||
const linesWithCss = insertCssImports(linesWithVuesticPlugin, css) | ||
fs.writeFileSync(api.resolve(api.entryFile), linesWithCss.join(EOL), { encoding: 'utf-8' }) | ||
}) | ||
@@ -57,0 +58,0 @@ } |
{ | ||
"name": "vue-cli-plugin-vuestic-ui", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "Vuestic UI plugin for Vue CLI v4+", | ||
@@ -5,0 +5,0 @@ "homepage": "https://vuestic.dev", |
@@ -9,4 +9,4 @@ // prompts.js | ||
name: 'treeshaking', | ||
message: 'Use treeshaking? You can configure it later.', | ||
default: true | ||
message: 'Use treeshaking? You will need to register all components manually.', | ||
default: false | ||
}, | ||
@@ -16,3 +16,3 @@ { | ||
name: 'treeshakingOptions', | ||
message: 'Select features that you want to use', | ||
message: 'Select CSS features that you want to use', | ||
default: [ | ||
@@ -19,0 +19,0 @@ 'grid', 'normalize', 'typography' |
8547
213