Skip to content

Commit d776884

Browse files
committed
build: update
1 parent 5825113 commit d776884

File tree

9 files changed

+53
-43
lines changed

9 files changed

+53
-43
lines changed

.babelrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.commitlintrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,25 @@
22
"extends": "airbnb-base",
33
"env": {
44
"browser": true
5-
}
5+
},
6+
"root": true,
7+
"rules": {
8+
"import/no-extraneous-dependencies": "off"
9+
},
10+
"overrides": [
11+
{
12+
"files": "test/**/*.js",
13+
"env": {
14+
"jquery": true,
15+
"mocha": true
16+
},
17+
"globals": {
18+
"$": true,
19+
"expect": true
20+
},
21+
"rules": {
22+
"no-unused-expressions": "off"
23+
}
24+
}
25+
]
626
}

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
node_modules
1+
*.local
22
*.map
3-
_*
3+
coverage
4+
node_modules

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ script:
55
- npm run lint
66
- npm run build
77
- npm test
8+
after_success:
9+
- npm run codecov

babel.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/preset-env',
5+
{
6+
modules: false,
7+
},
8+
],
9+
],
10+
env: {
11+
test: {
12+
plugins: [
13+
'istanbul',
14+
],
15+
},
16+
},
17+
};

test/karma.conf.js renamed to karma.conf.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
const puppeteer = require('puppeteer');
2-
const rollupConfig = require('../rollup.config');
2+
const rollupConfig = require('./rollup.config');
33

44
process.env.CHROME_BIN = puppeteer.executablePath();
5+
process.env.NODE_ENV = 'test';
56

67
module.exports = (config) => {
78
config.set({
89
autoWatch: false,
9-
basePath: '..',
10-
browsers: ['ChromeHeadlessWithoutSandbox'],
11-
customLaunchers: {
12-
ChromeHeadlessWithoutSandbox: {
13-
base: 'ChromeHeadless',
14-
flags: ['--no-sandbox'],
15-
},
10+
browsers: ['ChromeHeadless'],
11+
coverageIstanbulReporter: {
12+
reports: ['html', 'lcovonly', 'text-summary'],
1613
},
1714
files: [
18-
'node_modules/jquery/dist/jquery.js',
19-
'node_modules/cropperjs/dist/cropper.js',
2015
'node_modules/cropperjs/dist/cropper.css',
21-
'dist/jquery-cropper.js',
2216
'test/index.js',
2317
{
2418
pattern: 'docs/images/*',
@@ -29,11 +23,13 @@ module.exports = (config) => {
2923
preprocessors: {
3024
'test/index.js': ['rollup'],
3125
},
32-
reporters: ['mocha'],
26+
reporters: ['mocha', 'coverage-istanbul'],
3327
rollupPreprocessor: {
3428
plugins: rollupConfig.plugins,
3529
output: {
3630
format: 'iife',
31+
name: 'Anonymous',
32+
sourcemap: 'inline',
3733
},
3834
},
3935
singleRun: true,

rollup.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const pkg = require('./package');
77

88
const banner = createBanner({
99
data: {
10+
name: 'jQuery Cropper',
1011
year: '2018-present',
1112
},
1213
});
@@ -50,8 +51,6 @@ module.exports = {
5051
}),
5152
nodeResolve(),
5253
commonjs(),
53-
babel({
54-
plugins: ['external-helpers'],
55-
}),
54+
babel(),
5655
],
5756
};

test/.eslintrc

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)