zanui css build

This commit is contained in:
cookfront 2017-02-24 17:46:56 +08:00
parent 3ba60907b7
commit f524d6ccd2
26 changed files with 71 additions and 30 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ lib/*
!lib/style.css
node_modules
example/dist
dist

View File

@ -8,8 +8,6 @@ var OUTPUT_PATH = path.join(__dirname, '../../src/index.js');
var IMPORT_TEMPLATE = 'import {{name}} from \'../packages/{{package}}/index.js\';';
var ISNTALL_COMPONENT_TEMPLATE = ' Vue.component({{name}}.name, {{name}});';
var MAIN_TEMPLATE = `{{include}}
// zanui
import '../packages/zanui-css/src/index.pcss';
const install = function(Vue) {
if (install.installed) return;

View File

@ -6,7 +6,7 @@ config.entry = {
config.output = {
filename: './dist/[name].js',
library: 'Oxygen',
library: 'zanui',
libraryTarget: 'umd'
}

View File

@ -57,10 +57,6 @@ module.exports = {
},
{
test: /\.css$/,
loader: 'style-loader!css-loader?root=./docs/'
},
{
test: /\.pcss$/,
loader: 'style-loader!css-loader!postcss-loader'
},
{

View File

@ -21,6 +21,8 @@ export default {
</script>
<style lang="css">
@import './assets/docs.css';
.page-container {
width: 1140px;
padding: 0 30px;

View File

@ -1,4 +1,3 @@
import './assets/docs.css';
import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './App';
@ -7,6 +6,8 @@ import demoBlock from './components/demo-block';
import SideNav from './components/side-nav';
import Oxygen from '../src/index';
import 'packages/zanui-css/src/index.css';
Vue.use(Oxygen);
Vue.use(VueRouter);
Vue.component('demo-block', demoBlock);

View File

@ -11,9 +11,10 @@
],
"scripts": {
"bootstrap": "npm i --registry=http://registry.npm.qima-inc.com",
"build:file": "node build/bin/build-entry.js",
"build": "npm run clean && npm run lint && npm run build:file && npm run concat:dev && npm run concat:prod",
"dev": "npm run bootstrap && npm run build:file",
"build:file": "node build/bin/build-entry.js",
"build:zanui-css": "gulp build --gulpfile packages/zanui-css/gulpfile.js",
"build": "npm run clean && npm run lint && npm run build:file && webpack --progress --hide-modules --config build/webpack.build.min.js && webpack --progress --hide-modules --config build/webpack.build.js",
"builddocs": "webpack --progress --hide-modules --config build/webpack.config.js && set NODE_ENV=production webpack --progress --hide-modules --config build/webpack.config.js",
"docs": "npm run dev && webpack-dev-server --inline --hot --config build/webpack.config.js",
"clean": "rimraf lib && rimraf packages/*/lib",

View File

@ -18,7 +18,7 @@
</template>
<script>
import Popup from 'packages/popup';
import Popup from 'src/mixins/popup';
const CANCEL_TEXT = '取消';
const CONFIRM_TEXT = '确认';

View File

@ -0,0 +1 @@
# zanui-css

View File

@ -0,0 +1,13 @@
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var cssmin = require('gulp-cssmin');
var salad = require('postcss-salad')(require('./salad.config.json'));
gulp.task('compile', function() {
return gulp.src('./src/*.css')
.pipe(postcss([salad]))
.pipe(cssmin())
.pipe(gulp.dest('./lib'));
});
gulp.task('build', ['compile']);

View File

@ -1,10 +1,22 @@
{
"name": "@youzan/zenui",
"name": "@youzan/zanui-css",
"version": "0.0.1",
"description": "wap component style",
"main": "./lib/index.js",
"author": "niunai",
"description": "zanui css.",
"main": "lib/index.css",
"style": "lib/index.css",
"files": [
"lib",
"src"
],
"scripts": {
"build": "gulp build"
},
"license": "MIT",
"devDependencies": {},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-cssmin": "^0.1.7",
"gulp-postcss": "^6.1.1",
"postcss-salad": "^1.0.5"
},
"dependencies": {}
}

View File

@ -0,0 +1,16 @@
{
"browsers": ["ie > 8", "last 2 versions"],
"features": {
"bem": {
"shortcuts": {
"component": "b",
"modifier": "m",
"descendent": "e"
},
"separators": {
"descendent": "__",
"modifier": "--"
}
}
}
}

View File

@ -0,0 +1,14 @@
/**
css组件库入口组装成css组件库
*/
@import './button.css';
@import './button_group.css';
@import './cell.css';
@import './dialog.css';
@import './field.css';
@import './icon.css';
@import './loading.css';
@import './picker.css';
@import './popup.css';
@import './radio.css';
@import './switch.css';

View File

@ -1,12 +0,0 @@
/**
css组件库入口组装成css组件库
*/
@import './button.pcss';
@import './button_group.pcss';
@import './cell.pcss';
@import './dialog.pcss';
@import './field.pcss';
@import './icon.pcss';
@import './popup.pcss';
@import './picker.pcss';
@import './switch.pcss';

View File

@ -10,8 +10,6 @@ import Dialog from '../packages/dialog/index.js';
import Picker from '../packages/picker/index.js';
import RadioGroup from '../packages/radio-group/index.js';
import Loading from '../packages/loading/index.js';
// zanui
import '../packages/zanui-css/src/index.pcss';
const install = function(Vue) {
if (install.installed) return;