Skip to content

Commit

Permalink
Auto run
Browse files Browse the repository at this point in the history
  • Loading branch information
Xotic750 committed Aug 13, 2019
1 parent b67a96d commit c48fdf1
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ node_js:
- '8'
script:
- npm run test:ci
after_success:
- npm run test:ci-coveralls
matrix:
fast_finish: true
53 changes: 41 additions & 12 deletions dist/string-starts-with-x.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/string-starts-with-x.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/string-starts-with-x.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/string-starts-with-x.min.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"security-fix": "npm run security -- fix",
"start": "nodemon --exec \"npm run build\" --watch src",
"test": "npm run clean:coverage && jest",
"test:ci": "npm run test -- --ci --maxWorkers=2 --coverage --coverageReporters=text-lcov | coveralls",
"test:ci": "npm run test -- --ci --maxWorkers=2",
"test:ci-coveralls": "npm run test:ci -- --coverage --coverageReporters=text-lcov | coveralls",
"test:coverage": "npm run test -- --coverage"
},
"license": "MIT",
Expand Down Expand Up @@ -112,6 +113,7 @@
"webpack": "^4.39.1",
"webpack-bundle-analyzer": "^3.4.1",
"webpack-cli": "^3.3.6",
"webpack-global-object-x": "^1.0.0",
"webpack-merge": "^4.2.1"
},
"engines": {
Expand Down
21 changes: 2 additions & 19 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,9 @@ const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
const eslintFriendlyFormatter = require('eslint-friendly-formatter');
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer');
const camelCase = require('lodash/camelCase');
const globalObject = require('webpack-global-object-x');
const PACKAGE = require('./package.json');

const getGlobal = function() {
'use strict';

if (typeof self !== 'undefined') {
return self;
}

if (typeof window !== 'undefined') {
return window;
}

if (typeof global !== 'undefined') {
return global;
}

return Function('return this')();
};

const filename = PACKAGE.name.replace('@xotic750/', '');
const library = camelCase(filename);
const dist = path.resolve(__dirname, 'dist');
Expand Down Expand Up @@ -203,7 +186,7 @@ module.exports = function generateConfig(env) {
*/
output: {
// https://github.com/webpack/webpack/issues/6525
globalObject: `(${getGlobal.toString()}())`,
globalObject: `(${globalObject.toString()}())`,
library,
libraryTarget: 'umd',
path: dist,
Expand Down

0 comments on commit c48fdf1

Please sign in to comment.