mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
zanui css build
This commit is contained in:
parent
3ba60907b7
commit
f524d6ccd2
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,3 +9,4 @@ lib/*
|
|||||||
!lib/style.css
|
!lib/style.css
|
||||||
node_modules
|
node_modules
|
||||||
example/dist
|
example/dist
|
||||||
|
dist
|
||||||
|
@ -8,8 +8,6 @@ var OUTPUT_PATH = path.join(__dirname, '../../src/index.js');
|
|||||||
var IMPORT_TEMPLATE = 'import {{name}} from \'../packages/{{package}}/index.js\';';
|
var IMPORT_TEMPLATE = 'import {{name}} from \'../packages/{{package}}/index.js\';';
|
||||||
var ISNTALL_COMPONENT_TEMPLATE = ' Vue.component({{name}}.name, {{name}});';
|
var ISNTALL_COMPONENT_TEMPLATE = ' Vue.component({{name}}.name, {{name}});';
|
||||||
var MAIN_TEMPLATE = `{{include}}
|
var MAIN_TEMPLATE = `{{include}}
|
||||||
// zanui
|
|
||||||
import '../packages/zanui-css/src/index.pcss';
|
|
||||||
|
|
||||||
const install = function(Vue) {
|
const install = function(Vue) {
|
||||||
if (install.installed) return;
|
if (install.installed) return;
|
||||||
|
@ -6,7 +6,7 @@ config.entry = {
|
|||||||
|
|
||||||
config.output = {
|
config.output = {
|
||||||
filename: './dist/[name].js',
|
filename: './dist/[name].js',
|
||||||
library: 'Oxygen',
|
library: 'zanui',
|
||||||
libraryTarget: 'umd'
|
libraryTarget: 'umd'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,10 +57,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
loader: 'style-loader!css-loader?root=./docs/'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.pcss$/,
|
|
||||||
loader: 'style-loader!css-loader!postcss-loader'
|
loader: 'style-loader!css-loader!postcss-loader'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -21,6 +21,8 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="css">
|
<style lang="css">
|
||||||
|
@import './assets/docs.css';
|
||||||
|
|
||||||
.page-container {
|
.page-container {
|
||||||
width: 1140px;
|
width: 1140px;
|
||||||
padding: 0 30px;
|
padding: 0 30px;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import './assets/docs.css';
|
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import VueRouter from 'vue-router';
|
import VueRouter from 'vue-router';
|
||||||
import App from './App';
|
import App from './App';
|
||||||
@ -7,6 +6,8 @@ import demoBlock from './components/demo-block';
|
|||||||
import SideNav from './components/side-nav';
|
import SideNav from './components/side-nav';
|
||||||
import Oxygen from '../src/index';
|
import Oxygen from '../src/index';
|
||||||
|
|
||||||
|
import 'packages/zanui-css/src/index.css';
|
||||||
|
|
||||||
Vue.use(Oxygen);
|
Vue.use(Oxygen);
|
||||||
Vue.use(VueRouter);
|
Vue.use(VueRouter);
|
||||||
Vue.component('demo-block', demoBlock);
|
Vue.component('demo-block', demoBlock);
|
||||||
|
@ -11,9 +11,10 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"bootstrap": "npm i --registry=http://registry.npm.qima-inc.com",
|
"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",
|
"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",
|
"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",
|
"docs": "npm run dev && webpack-dev-server --inline --hot --config build/webpack.config.js",
|
||||||
"clean": "rimraf lib && rimraf packages/*/lib",
|
"clean": "rimraf lib && rimraf packages/*/lib",
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Popup from 'packages/popup';
|
import Popup from 'src/mixins/popup';
|
||||||
|
|
||||||
const CANCEL_TEXT = '取消';
|
const CANCEL_TEXT = '取消';
|
||||||
const CONFIRM_TEXT = '确认';
|
const CONFIRM_TEXT = '确认';
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
# zanui-css
|
13
packages/zanui-css/gulpfile.js
Normal file
13
packages/zanui-css/gulpfile.js
Normal 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']);
|
@ -1,10 +1,22 @@
|
|||||||
{
|
{
|
||||||
"name": "@youzan/zenui",
|
"name": "@youzan/zanui-css",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "wap component style",
|
"description": "zanui css.",
|
||||||
"main": "./lib/index.js",
|
"main": "lib/index.css",
|
||||||
"author": "niunai",
|
"style": "lib/index.css",
|
||||||
|
"files": [
|
||||||
|
"lib",
|
||||||
|
"src"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"build": "gulp build"
|
||||||
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {},
|
"devDependencies": {
|
||||||
|
"gulp": "^3.9.1",
|
||||||
|
"gulp-cssmin": "^0.1.7",
|
||||||
|
"gulp-postcss": "^6.1.1",
|
||||||
|
"postcss-salad": "^1.0.5"
|
||||||
|
},
|
||||||
"dependencies": {}
|
"dependencies": {}
|
||||||
}
|
}
|
||||||
|
16
packages/zanui-css/salad.config.json
Normal file
16
packages/zanui-css/salad.config.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"browsers": ["ie > 8", "last 2 versions"],
|
||||||
|
"features": {
|
||||||
|
"bem": {
|
||||||
|
"shortcuts": {
|
||||||
|
"component": "b",
|
||||||
|
"modifier": "m",
|
||||||
|
"descendent": "e"
|
||||||
|
},
|
||||||
|
"separators": {
|
||||||
|
"descendent": "__",
|
||||||
|
"modifier": "--"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
14
packages/zanui-css/src/index.css
Normal file
14
packages/zanui-css/src/index.css
Normal 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';
|
@ -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';
|
|
@ -10,8 +10,6 @@ import Dialog from '../packages/dialog/index.js';
|
|||||||
import Picker from '../packages/picker/index.js';
|
import Picker from '../packages/picker/index.js';
|
||||||
import RadioGroup from '../packages/radio-group/index.js';
|
import RadioGroup from '../packages/radio-group/index.js';
|
||||||
import Loading from '../packages/loading/index.js';
|
import Loading from '../packages/loading/index.js';
|
||||||
// zanui
|
|
||||||
import '../packages/zanui-css/src/index.pcss';
|
|
||||||
|
|
||||||
const install = function(Vue) {
|
const install = function(Vue) {
|
||||||
if (install.installed) return;
|
if (install.installed) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user