Add named exports.

`import dat from 'dat.gui'` is now interchangeable with
`import * as dat from 'dat.gui'`
This commit is contained in:
efokschaner 2018-04-30 22:21:34 -07:00 committed by Don McCurdy
parent 4a08249e30
commit fdcd266249
10 changed files with 587 additions and 573 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -44,7 +44,7 @@
"rollup-plugin-node-resolve": "^3.0.2",
"rollup-plugin-sass": "^0.5.3",
"rollup-plugin-uglify": "^2.0.1",
"serve": "^6.4.8"
"serve": "^6.4.8 <6.5.4"
},
"eslintConfig": {
"extends": "airbnb-base",

View File

@ -23,6 +23,7 @@ const banner = fs.readFileSync(path.join(__dirname, 'licenseBanner.txt'));
export default {
input: 'src/dat/index.js',
output: [{
exports: 'named',
file: './build/dat.gui.js',
format: 'umd',
name: 'dat',

View File

@ -20,6 +20,7 @@ const banner = fs.readFileSync(path.join(__dirname, 'licenseBanner.txt'));
export default Object.assign({}, defaultConfig, {
output: {
exports: 'named',
file: './build/dat.gui.min.js',
format: 'umd',
name: 'dat',

View File

@ -25,17 +25,16 @@ import NumberControllerSlider from './controllers/NumberControllerSlider';
import FunctionController from './controllers/FunctionController';
import ColorController from './controllers/ColorController';
import dom from './dom/dom';
import GUI from './gui/GUI';
import domImport from './dom/dom';
import GUIImport from './gui/GUI';
export default {
color: {
export const color = {
Color: Color,
math: math,
interpret: interpret
},
};
controllers: {
export const controllers = {
Controller: Controller,
BooleanController: BooleanController,
OptionController: OptionController,
@ -45,15 +44,18 @@ export default {
NumberControllerSlider: NumberControllerSlider,
FunctionController: FunctionController,
ColorController: ColorController
},
dom: {
dom: dom
},
gui: {
GUI: GUI
},
GUI: GUI
};
export const dom = { dom: domImport };
export const gui = { GUI: GUIImport };
export const GUI = GUIImport;
export default {
color,
controllers,
dom,
gui,
GUI
};