Comparing version 0.20.4 to 0.20.5
@@ -0,1 +1,11 @@ | ||
## [0.20.5](https://github.com/vuejs/vite/compare/v0.20.4...v0.20.5) (2020-06-05) | ||
### Bug Fixes | ||
* ensure postcss-import is applied first ([a383ec3](https://github.com/vuejs/vite/commit/a383ec347bbba453bfae49f403d9850b31f3122d)), closes [#355](https://github.com/vuejs/vite/issues/355) | ||
* proper handling of custom postcss config for build ([5b1e25d](https://github.com/vuejs/vite/commit/5b1e25d710a6f7e56d4d364a78c332ce7840cb63)), closes [#354](https://github.com/vuejs/vite/issues/354) | ||
## [0.20.4](https://github.com/vuejs/vite/compare/v0.20.3...v0.20.4) (2020-06-05) | ||
@@ -2,0 +12,0 @@ |
@@ -21,11 +21,16 @@ "use strict"; | ||
if (id.endsWith('.css') || cssUtils_1.cssPreprocessLangRE.test(id)) { | ||
const result = await cssUtils_1.compileCss(root, id, { | ||
id: '', | ||
source: css, | ||
filename: id, | ||
scoped: false, | ||
modules: id.endsWith('.module.css'), | ||
preprocessLang: id.replace(cssUtils_1.cssPreprocessLangRE, '$2'), | ||
preprocessOptions | ||
}); | ||
// if this is a Vue SFC style request, it's already processed by | ||
// rollup-plugin-vue and we just need to rewrite URLs + collect it | ||
const isVueStyle = /\?vue&type=style/.test(id); | ||
const result = isVueStyle | ||
? css | ||
: await cssUtils_1.compileCss(root, id, { | ||
id: '', | ||
source: css, | ||
filename: id, | ||
scoped: false, | ||
modules: id.endsWith('.module.css'), | ||
preprocessLang: id.replace(cssUtils_1.cssPreprocessLangRE, '$2'), | ||
preprocessOptions | ||
}); | ||
let modules; | ||
@@ -32,0 +37,0 @@ if (typeof result === 'string') { |
@@ -20,2 +20,3 @@ "use strict"; | ||
const hash_sum_1 = __importDefault(require("hash-sum")); | ||
const cssUtils_1 = require("../utils/cssUtils"); | ||
const writeColors = { | ||
@@ -59,2 +60,3 @@ [0 /* JS */]: chalk_1.default.cyan, | ||
const dynamicImport = require('rollup-plugin-dynamic-import-variables'); | ||
const { options: postcssOptions, plugins: postcssPlugins } = await cssUtils_1.resolvePostcssOptions(root); | ||
return [ | ||
@@ -73,2 +75,4 @@ // user plugins | ||
}, | ||
postcssOptions, | ||
postcssPlugins, | ||
preprocessStyles: true, | ||
@@ -75,0 +79,0 @@ preprocessOptions: { |
@@ -8,4 +8,8 @@ import { SFCAsyncStyleCompileOptions, SFCStyleCompileResults } from '@vue/compiler-sfc'; | ||
export declare function codegenCss(id: string, css: string, modules?: Record<string, string>): string; | ||
export declare function resolvePostcssOptions(root: string): Promise<{ | ||
options: import("postcss").ProcessOptions | null; | ||
plugins: (import("postcss").Transformer | import("postcss").Processor | import("postcss").Plugin<any>)[]; | ||
}>; | ||
export declare const cssImportMap: Map<string, Set<string>>; | ||
export declare function getCssImportBoundaries(filePath: string, boundaries?: Set<string>): Set<string>; | ||
export {}; |
@@ -14,3 +14,3 @@ "use strict"; | ||
exports.urlRE = /(url\(\s*['"]?)([^"')]+)(["']?\s*\))/; | ||
exports.cssPreprocessLangRE = /(.+).(less|sass|scss|styl|stylus)$/; | ||
exports.cssPreprocessLangRE = /(.+).(less|sass|scss|styl|stylus|postcss)$/; | ||
function rewriteCssUrls(css, replacerOrBase) { | ||
@@ -39,3 +39,3 @@ let replacer; | ||
const id = hash_sum_1.default(publicPath); | ||
let postcssConfig = await loadPostcssConfig(root); | ||
const postcssConfig = await loadPostcssConfig(root); | ||
const { compileStyleAsync } = resolveVue_1.resolveCompiler(root); | ||
@@ -49,5 +49,3 @@ if (publicPath.endsWith('.css') && | ||
} | ||
const postcssOptions = postcssConfig && postcssConfig.options; | ||
const postcssPlugins = postcssConfig ? postcssConfig.plugins : []; | ||
postcssPlugins.push(require('postcss-import')()); | ||
const { options: postcssOptions, plugins: postcssPlugins } = await resolvePostcssOptions(root); | ||
const res = await compileStyleAsync({ | ||
@@ -118,2 +116,13 @@ source, | ||
} | ||
async function resolvePostcssOptions(root) { | ||
const config = await loadPostcssConfig(root); | ||
const options = config && config.options; | ||
const plugins = config ? config.plugins : []; | ||
plugins.unshift(require('postcss-import')()); | ||
return { | ||
options, | ||
plugins | ||
}; | ||
} | ||
exports.resolvePostcssOptions = resolvePostcssOptions; | ||
exports.cssImportMap = new Map(); | ||
@@ -120,0 +129,0 @@ function getCssImportBoundaries(filePath, boundaries = new Set()) { |
{ | ||
"name": "vite", | ||
"version": "0.20.4", | ||
"version": "0.20.5", | ||
"license": "MIT", | ||
@@ -95,3 +95,3 @@ "author": "Evan You", | ||
"rollup-plugin-terser": "^5.3.0", | ||
"rollup-plugin-vue": "^6.0.0-beta.5", | ||
"rollup-plugin-vue": "^6.0.0-beta.6", | ||
"selfsigned": "^1.10.7", | ||
@@ -98,0 +98,0 @@ "slash": "^3.0.0", |
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
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
303559
5467
+ Added@vue/compiler-core@3.5.12(transitive)
+ Added@vue/compiler-dom@3.5.12(transitive)
+ Added@vue/compiler-sfc@3.5.12(transitive)
+ Added@vue/compiler-ssr@3.5.12(transitive)
+ Added@vue/reactivity@3.5.12(transitive)
+ Added@vue/runtime-core@3.5.12(transitive)
+ Added@vue/runtime-dom@3.5.12(transitive)
+ Added@vue/server-renderer@3.5.12(transitive)
+ Added@vue/shared@3.5.12(transitive)
+ Addedvue@3.5.12(transitive)
- Removed@vue/compiler-core@3.5.13(transitive)
- Removed@vue/compiler-dom@3.5.13(transitive)
- Removed@vue/compiler-sfc@3.5.13(transitive)
- Removed@vue/compiler-ssr@3.5.13(transitive)
- Removed@vue/reactivity@3.5.13(transitive)
- Removed@vue/runtime-core@3.5.13(transitive)
- Removed@vue/runtime-dom@3.5.13(transitive)
- Removed@vue/server-renderer@3.5.13(transitive)
- Removed@vue/shared@3.5.13(transitive)
- Removedvue@3.5.13(transitive)