summaryrefslogtreecommitdiffstats
path: root/.config
diff options
context:
space:
mode:
authordotnetCarpenter <jon.ronnenberg@gmail.com>2018-11-13 22:36:14 +0100
committerdotnetCarpenter <jon.ronnenberg@gmail.com>2018-11-13 22:36:14 +0100
commit2708d5f3bcb663b8cb3d2f0b206fe38a89fd4bea (patch)
treed1618b98a7dd34a3dadd3bed58915f2894a6fdff /.config
parent55edb9a2a346470de6ba5dc3b157c85849753c85 (diff)
downloadsvg.js-2708d5f3bcb663b8cb3d2f0b206fe38a89fd4bea.tar.gz
svg.js-2708d5f3bcb663b8cb3d2f0b206fe38a89fd4bea.zip
committing so @fuzzyma can continue the work
Diffstat (limited to '.config')
-rw-r--r--.config/karma.conf.saucelabs.js19
-rw-r--r--.config/polyfills.js18
-rw-r--r--.config/rollup.config.js111
3 files changed, 135 insertions, 13 deletions
diff --git a/.config/karma.conf.saucelabs.js b/.config/karma.conf.saucelabs.js
index 45f0472..827d5b8 100644
--- a/.config/karma.conf.saucelabs.js
+++ b/.config/karma.conf.saucelabs.js
@@ -2,7 +2,7 @@
// https://wiki.saucelabs.com/display/DOCS/Platform+Configurator
// TODO: remove dotenv after local test
-// require('dotenv').config()
+require('dotenv').config()
const karmaCommon = require('./karma.conf.common.js')
@@ -34,6 +34,11 @@ const SauceLabsLaunchers = {
base: 'SauceLabs',
browserName: 'chrome',
version: 'latest'
+ },
+ SL_InternetExplorer: {
+ base: 'SauceLabs',
+ browserName: 'internet explorer',
+ version: '11.0'
},/*
sl_windows_edge: {
base: 'SauceLabs',
@@ -70,24 +75,12 @@ const SauceLabsLaunchers = {
version: '50.0',
platform: 'Windows 10'
},
- 'SL_InternetExplorer': {
- base: 'SauceLabs',
- browserName: 'internet explorer',
- version: '11.0',
- platform: 'Windows 7'
- },
'SL_Safari': {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.11',
version: '10.0'
} */
- 'SL_Chrome_70': {
- base: 'SauceLabs',
- browserName: 'chrome',
- platform: 'Windows 10',
- version: '70.0'
- }
}
diff --git a/.config/polyfills.js b/.config/polyfills.js
new file mode 100644
index 0000000..d73adb8
--- /dev/null
+++ b/.config/polyfills.js
@@ -0,0 +1,18 @@
+import 'core-js/modules/es6.date.to-string';
+import 'core-js/modules/es6.function.name';
+import 'core-js/modules/es6.object.keys';
+import 'core-js/modules/es7.symbol.async-iterator';
+import 'core-js/modules/es6.symbol';
+import 'core-js/modules/es6.string.iterator';
+import 'core-js/modules/es6.set';
+import 'core-js/modules/es6.regexp.match';
+import 'core-js/modules/es7.array.includes';
+import 'core-js/modules/es6.string.includes';
+import 'core-js/modules/es6.array.iterator';
+import 'core-js/modules/es7.object.entries';
+import 'core-js/modules/es6.object.assign';
+import 'core-js/modules/es6.regexp.to-string';
+import 'core-js/modules/es6.regexp.replace';
+import 'core-js/modules/es6.regexp.split';
+import 'core-js/modules/web.dom.iterable';
+import 'core-js/modules/es6.array.find';
diff --git a/.config/rollup.config.js b/.config/rollup.config.js
new file mode 100644
index 0000000..b7ad5d8
--- /dev/null
+++ b/.config/rollup.config.js
@@ -0,0 +1,111 @@
+import babel from 'rollup-plugin-babel'
+import * as pkg from '../package.json'
+// import filesize from 'rollup-plugin-filesize'
+import { terser } from 'rollup-plugin-terser'
+
+const buildDate = Date()
+
+const headerLong = `/*!
+* ${pkg.name} - ${pkg.description}
+* @version ${pkg.version}
+* ${pkg.homepage}
+*
+* @copyright ${pkg.author}
+* @license ${pkg.license}
+*
+* BUILT: ${buildDate}
+*/;`
+
+const headerShort = `/*! ${pkg.name} v${pkg.version} ${pkg.license}*/;`
+
+const config = esm => ({
+ input: './src/svg.js',
+ output: {
+ file: esm ? './dist/svg.js' : './dist/svg.min.js',
+ name: 'SVG',
+ sourceMap: !esm,
+ format: esm ? 'esm' : 'iife',
+ banner: esm ? headerShort : headerLong,
+ plugins:
+ esm
+ ? []
+ : [
+ babel({
+ include: 'src/**',
+ runtimeHelpers: true,
+ babelrc: false,
+ presets: [["@babel/preset-env", {
+ modules: false,
+ targets: {
+ ie: 9,
+ chrome: 49,
+ edge: 14,
+ firefox: 45,
+ safari: 10
+ },
+ useBuiltIns: 'usage'
+ }]]
+ }),
+ terser()
+ ]
+ }
+})
+
+const modes = [true, false]
+
+// console.log(modes.map(config))
+export default modes.map(config)
+
+// export default [
+// {
+// input: './src/svg.js',
+// output: {
+// file: 'dist/svg.js',
+// name: 'SVG',
+// sourceMap: true,
+// format: 'iife',
+// banner: headerLong
+// },
+// plugins: [
+// // resolve({browser: true}),
+// // commonjs(),
+// babel({
+// include: 'src/**',
+// runtimeHelpers: true,
+// babelrc: false,
+// presets: [["@babel/preset-env", {
+// modules: false,
+// targets: {
+// ie: "9"
+// },
+// useBuiltIns: 'usage'
+// }]],
+// }),
+// filesize()
+// ]
+// },{
+// input: './.config/polyfills.js',
+// output: {
+// file: 'dist/polyfills.js',
+// name: 'SVG',
+// sourceMap: true,
+// format: 'umd',
+// banner: headerLong
+// },
+// treeshake: false,
+// plugins: [
+// // babel({
+// // runtimeHelpers: true,
+// // babelrc: false,
+// // presets: [["@babel/preset-env", {
+// // modules: false,
+// // targets: {
+// // ie: "11"
+// // },
+// // useBuiltIns: 'usage'
+// // }]],
+// // }),
+// filesize()
+// ]
+// },
+// ]