-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
107 additions
and
20 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import paramCase from 'param-case'; | ||
import pascalCase from 'pascal-case'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import nodeBuiltins from 'rollup-plugin-node-builtins'; | ||
import nodeGlobals from 'rollup-plugin-node-globals'; | ||
import nodeResolve from 'rollup-plugin-node-resolve'; | ||
import sourcemaps from 'rollup-plugin-sourcemaps'; | ||
// import uglify from 'rollup-plugin-uglify'; | ||
|
||
const pkg = require('./package'); | ||
|
||
const moduleName = pascalCase(pkg.name) | ||
|
||
export default { | ||
dest: `dist/${paramCase(pkg.name)}.es2015.js`, | ||
entry: 'dist/es2015/index.js', | ||
exports: 'named', | ||
format: 'iife', | ||
moduleId: pkg.name, | ||
moduleName, | ||
// This may comes handy | ||
// onwarn(warning) { | ||
// // Suppress this error message: "The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten" | ||
// // https://github.com/rollup/rollup/issues/794 | ||
// if (warning.code === 'THIS_IS_UNDEFINED') { | ||
// return | ||
// } | ||
|
||
// console.error(warning.message) | ||
// }, | ||
plugins: [ | ||
sourcemaps(), | ||
nodeResolve({ | ||
jsnext: true | ||
}), | ||
nodeGlobals(), | ||
nodeBuiltins(), | ||
commonjs(), | ||
// uglify() | ||
], | ||
sourceMap: true | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
require('browser-env')() | ||
|
||
// "test": "npm run clean && tsc && ava && export BROWSER_TEST=true; ava", | ||
// if (process.env.BROWSER_TEST) { | ||
// require('browser-env')() | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
require('aurelia-polyfills') | ||
const LogManager = require('aurelia-logging') | ||
const ConsoleAppender = require('aurelia-logging-console').ConsoleAppender | ||
const ColorAppender = require('aurelia-logging-color').ColorAppender | ||
|
||
LogManager.addAppender(new ConsoleAppender()) | ||
LogManager.addAppender(new ColorAppender()) | ||
|
||
LogManager.setLevel(LogManager.logLevel.debug) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "dist/es2015", | ||
"sourceRoot": "/color-map", | ||
"target": "es2015" | ||
}, | ||
"files": [ | ||
"src/index.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "dist/commonjs", | ||
"outDir": "dist/es5", | ||
"sourceRoot": "/color-map" | ||
}, | ||
"files": [ | ||
"src/index.ts" | ||
], | ||
"include": [ | ||
"typings/index.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
"buildOnSave": false, | ||
"compileOnSave": false, | ||
"include": [ | ||
"src/**/*", | ||
"typings/index.d.ts" | ||
"src/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'use strict'; | ||
const paramCase = require('param-case') | ||
const pascalCase = require('pascal-case') | ||
const path = require('path') | ||
const webpack = require('webpack') | ||
|
||
const pjson = require('./package.json') | ||
|
||
const filename = paramCase(pjson.name) | ||
const globalVariable = pascalCase(filename) | ||
|
||
module.exports = { | ||
devtool: 'source-map', | ||
entry: { | ||
[filename]: './dist/es5/index' | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
enforce: 'pre', | ||
loader: "source-map-loader", | ||
test: /\.js?$/ | ||
} | ||
] | ||
}, | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: `${filename}.es5.js`, | ||
library: globalVariable, | ||
libraryTarget: 'var' | ||
} | ||
} |