Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
moyus committed Mar 8, 2019
2 parents 9d8b904 + 43048bb commit 5a76442
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Change Log
toc: hidden
---

### 2.1.3
### 2.1.4

`2019-03-08`

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 更新日志
toc: hidden
---

### 2.1.3
### 2.1.4

`2019-03-08`

Expand Down
7 changes: 5 additions & 2 deletions build/rollup/build-component.rollup.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ function compileVueStylus (content, cb, compiler, filePath) {
if (err) {
throw err
}
const {plugins} = await findPostcssConfig()
const {plugins} = await findPostcssConfig({
env: process.env.NODE_ENV
})

postcss(plugins)
.process(css, {
from: undefined
Expand Down Expand Up @@ -197,4 +200,4 @@ function main() {
})
}

main()
main()
4 changes: 3 additions & 1 deletion build/rollup/rollup-plugin-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ async function vueWarpper() {
const {
options,
plugins,
} = await findPostcssConfig({})
} = await findPostcssConfig({
env: process.env.NODE_ENV
})
return [
css({
output: path.resolve(distDir, fileName)
Expand Down
12 changes: 10 additions & 2 deletions build/rollup/rollup-plugin-example-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

const path = require('path')
const fs = require('fs')
const aliasPlugin = require('rollup-plugin-alias')
const replacePlugin = require('rollup-plugin-replace')
const jsonPlugin = require('rollup-plugin-json')
Expand Down Expand Up @@ -36,10 +37,17 @@ async function vueWarpper() {
const {
options,
plugins,
} = await findPostcssConfig({})
} = await findPostcssConfig({
env: process.env.NODE_ENV
})

return [
css({
output: path.resolve(distDir, fileName)
output(styles) {
setTimeout(function () {
fs.writeFileSync(path.resolve(distDir, fileName), styles)
}, 0)
}
}),
vuePlugin({
css: false,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mand-mobile",
"version": "2.1.3",
"version": "2.1.4",
"description": "A Vue.js 2.0 Mobile UI Toolkit",
"homepage": "https://github.com/didi/mand-mobile",
"main": "lib/mand-mobile.umd.js",
Expand Down Expand Up @@ -37,7 +37,7 @@
"build:mand-mobile-esm": "cross-env NODE_ENV=production BUILD_TYPE=esm node build/rollup/build-mand-mobile.rollup",
"build:mand-mobile-umd": "cross-env NODE_ENV=production BUILD_TYPE=umd node build/rollup/build-mand-mobile.rollup",
"build:mand-mobile-variables": "npm run build:variables && cross-env NODE_ENV=production BUILD_TYPE=variables node build/rollup/build-mand-mobile.rollup",
"build:components": "cross-env NODE_ENV=production && node build/rollup/build-component.rollup",
"build:components": "cross-env NODE_ENV=production node build/rollup/build-component.rollup",
"build:responsive": "node build/rollup/build-vw-responsive",
"build:variables": "node build/rollup/build-css-variables",
"build:analysis": "cross-env NODE_ENV=production node build/webpack/build-mand-mobile --analysis",
Expand Down
15 changes: 11 additions & 4 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

// https://github.com/michael-ciniawsky/postcss-load-config
const browserslist = require('./package.json').browserslist
module.exports = () => ({
plugins: {
'postcss-pxtorem': process.env.NODE_ENV !== 'production' ? { rootValue: 100, minPixelValue: 2, propWhiteList: [] } : false,
module.exports = () => {
const plugins = {
'postcss-url': {url: 'inline'},
'cssnano': {
preset: ['default', {
Expand All @@ -16,4 +15,12 @@ module.exports = () => ({
},
'autoprefixer': { browsers: browserslist }
}
})

if (process.env.NODE_ENV !== 'production' || process.env.BUILD_TYPE === 'example') {
plugins['postcss-pxtorem'] = { rootValue: 100, minPixelValue: 2, propWhiteList: [] }
}

return {
plugins
}
}

0 comments on commit 5a76442

Please sign in to comment.