Skip to content

Commit

Permalink
- Add ESM bundle.
Browse files Browse the repository at this point in the history
- Update dependencies (Webpack, Karma, etc)
- Remove Babel regenerator runtime and preset-env.
  • Loading branch information
brochington committed May 27, 2021
1 parent 530469b commit e9cedb7
Show file tree
Hide file tree
Showing 10 changed files with 1,858 additions and 4,003 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

### 5.0.0 - May 26, 2021
- Add ESM bundle.
- Update dependencies (Webpack, Karma, etc)
- Remove Babel regenerator runtime and preset-env.

### 4.2.5 - Feb 27, 2021

- Add better internal initialization state structure.
Expand Down
2 changes: 1 addition & 1 deletion build/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/bundle.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions build/esm-bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/esm-bundle.js.map

Large diffs are not rendered by default.

79 changes: 35 additions & 44 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,101 +3,92 @@

var travisENV = process.env.NODE_ENV === 'travis';

module.exports = function(config) {
console.log(process.env.NODE_ENV)
module.exports = function (config) {
console.log(process.env.NODE_ENV);
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',

plugins: [
'karma-mocha',
'karma-chai',
'karma-webpack',
'karma-mocha-reporter',
].concat(travisENV ? ['karma-firefox-launcher'] : ['karma-chrome-launcher']),
'karma-mocha',
'karma-chai',
'karma-webpack',
'karma-mocha-reporter',
].concat(
travisENV ? ['karma-firefox-launcher'] : ['karma-chrome-launcher']
),

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai'],


// list of files / patterns to load in the browser
files: [
'src/**/*.test.ts'
],

files: ['src/**/*.test.ts'],

// list of files to exclude
exclude: [
],
exclude: [],

webpack: {
mode: 'production',
module: {
rules: [{
test: /\.ts$/,
loader: 'babel-loader',
options: {
presets: [
'@babel/preset-typescript',
'@babel/preset-env'
],
plugins: [
["@babel/plugin-transform-runtime", {
"helpers": false,
"regenerator": true,
}],
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-class-properties'
]
}
}]
rules: [
{
test: /\.ts$/,
loader: 'babel-loader',
options: {
presets: ['@babel/preset-typescript', '@babel/preset-env'],
plugins: [
[
'@babel/plugin-transform-runtime',
{
helpers: false,
regenerator: true,
},
],
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-class-properties',
],
},
},
],
},
resolve: { extensions: ['.js', '.jsx', '.tsx', '.ts', '.json'] },
},

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'src/**/*.test.ts': ['webpack']
'src/**/*.test.ts': ['webpack'],
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['mocha'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: travisENV ? ['Firefox'] : ['Chrome'],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
})
}
concurrency: Infinity,
});
};
Loading

0 comments on commit e9cedb7

Please sign in to comment.