Skip to content

Commit

Permalink
feat: 更新配置
Browse files Browse the repository at this point in the history
  • Loading branch information
李怡欣 committed Apr 10, 2019
1 parent c977d5d commit 41bc02b
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 65 deletions.
30 changes: 30 additions & 0 deletions dist/index.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@
(global.ATAmbient = factory());
}(this, (function () { 'use strict';

function styleInject(css, ref) {
if ( ref === void 0 ) ref = {};
var insertAt = ref.insertAt;

if (!css || typeof document === 'undefined') { return; }

var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.type = 'text/css';

if (insertAt === 'top') {
if (head.firstChild) {
head.insertBefore(style, head.firstChild);
} else {
head.appendChild(style);
}
} else {
head.appendChild(style);
}

if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
}

var css = "@charset \"UTF-8\";\n/* 自定义样式 */\n.o2team_ambient_main {\n z-index: 999;\n pointer-events: none; }\n";
styleInject(css);

const id = 'particles_emission';
const ID = id.toUpperCase();
const O2_AMBIENT_MAIN = `O2_AMBIENT_${ID}_MAIN`;
Expand Down
2 changes: 1 addition & 1 deletion dist/index.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.min.js.map

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@o2team/ambient-particles_emission",
"version": "1.0.1",
"version": "1.0.2",
"description": "夸克动效库-粒子呼吸",
"main": "dist/index.min.js",
"scripts": {
Expand All @@ -25,8 +25,7 @@
"rollup-plugin-commonjs": "^9.3.1",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^4.0.1",
"rollup-plugin-sass": "^1.2.2",
"rollup-plugin-style": "^0.1.0",
"rollup-plugin-postcss": "^2.0.3",
"rollup-plugin-uglify": "^6.0.2"
}
}
55 changes: 5 additions & 50 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import babel from 'rollup-plugin-babel'
import { uglify } from 'rollup-plugin-uglify'
import scss from 'rollup-plugin-sass'
import json from 'rollup-plugin-json'
import style from 'rollup-plugin-style'
import postcss from 'rollup-plugin-postcss'

const name = 'ATAmbient'

Expand All @@ -20,30 +18,9 @@ export default [{
commonjs(),
babel({
comments: true,
exclude: ['node_modules/**', 'src/js/utils/bodymovin.js']
exclude: 'node_modules/**'
}),
json({
// All JSON files will be parsed by default,
// but you can also specifically include/exclude files
// include: 'node_modules/**',
exclude: 'node_modules/**',

// for tree-shaking, properties will be declared as
// variables, using either `var` or `const`
preferConst: true, // Default: false

// specify indentation for the generated default export —
// defaults to '\t'
indent: ' ',

// ignores indent and generates the smallest code
compact: true, // Default: false

// generate a named export for every property of the JSON object
namedExports: true // Default: true
}),
scss(),
style()
postcss()
]
}, {
input: 'src/rollup_index.js',
Expand All @@ -58,31 +35,9 @@ export default [{
commonjs(),
babel({
presets: [["@babel/preset-env"]],
exclude: ['node_modules/**', 'src/js/utils/bodymovin.js']
}),
scss(),
json({
// All JSON files will be parsed by default,
// but you can also specifically include/exclude files
// include: 'node_modules/**',
exclude: 'node_modules/**',

// for tree-shaking, properties will be declared as
// variables, using either `var` or `const`
preferConst: false, // Default: false

// specify indentation for the generated default export —
// defaults to '\t'
indent: ' ',

// ignores indent and generates the smallest code
compact: true, // Default: false

// generate a named export for every property of the JSON object
namedExports: true // Default: true
exclude: 'node_modules/**'
}),
scss(),
style(),
postcss(),
uglify()
]
}]
8 changes: 2 additions & 6 deletions src/css/base.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* 样式重置
* 样式重置,将不会被打包进代码包
*/

* {
-webkit-tap-highlight-color: transparent;
outline: 0;
Expand All @@ -14,8 +15,3 @@ body {
padding: 0;
vertical-align: baseline;
}

.o2team_ambient_main {
z-index: 999;
pointer-events: none;
}
9 changes: 5 additions & 4 deletions src/css/package.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* 页面的基础样式,包括样式重置
*/
@import "base";
/* 自定义样式 */

.o2team_ambient_main {
z-index: 999;
pointer-events: none;
}
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './css/base.scss'
import './css/package.scss'

import { O2_AMBIENT_CONFIG } from './js/utils/const'
Expand Down

0 comments on commit 41bc02b

Please sign in to comment.