Skip to content

Commit

Permalink
build: update
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Oct 19, 2019
1 parent 5825113 commit d776884
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 43 deletions.
10 changes: 0 additions & 10 deletions .babelrc

This file was deleted.

3 changes: 0 additions & 3 deletions .commitlintrc

This file was deleted.

22 changes: 21 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,25 @@
"extends": "airbnb-base",
"env": {
"browser": true
}
},
"root": true,
"rules": {
"import/no-extraneous-dependencies": "off"
},
"overrides": [
{
"files": "test/**/*.js",
"env": {
"jquery": true,
"mocha": true
},
"globals": {
"$": true,
"expect": true
},
"rules": {
"no-unused-expressions": "off"
}
}
]
}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
*.local
*.map
_*
coverage
node_modules
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ script:
- npm run lint
- npm run build
- npm test
after_success:
- npm run codecov
17 changes: 17 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
modules: false,
},
],
],
env: {
test: {
plugins: [
'istanbul',
],
},
},
};
20 changes: 8 additions & 12 deletions test/karma.conf.js → karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
const puppeteer = require('puppeteer');
const rollupConfig = require('../rollup.config');
const rollupConfig = require('./rollup.config');

process.env.CHROME_BIN = puppeteer.executablePath();
process.env.NODE_ENV = 'test';

module.exports = (config) => {
config.set({
autoWatch: false,
basePath: '..',
browsers: ['ChromeHeadlessWithoutSandbox'],
customLaunchers: {
ChromeHeadlessWithoutSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
browsers: ['ChromeHeadless'],
coverageIstanbulReporter: {
reports: ['html', 'lcovonly', 'text-summary'],
},
files: [
'node_modules/jquery/dist/jquery.js',
'node_modules/cropperjs/dist/cropper.js',
'node_modules/cropperjs/dist/cropper.css',
'dist/jquery-cropper.js',
'test/index.js',
{
pattern: 'docs/images/*',
Expand All @@ -29,11 +23,13 @@ module.exports = (config) => {
preprocessors: {
'test/index.js': ['rollup'],
},
reporters: ['mocha'],
reporters: ['mocha', 'coverage-istanbul'],
rollupPreprocessor: {
plugins: rollupConfig.plugins,
output: {
format: 'iife',
name: 'Anonymous',
sourcemap: 'inline',
},
},
singleRun: true,
Expand Down
5 changes: 2 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const pkg = require('./package');

const banner = createBanner({
data: {
name: 'jQuery Cropper',
year: '2018-present',
},
});
Expand Down Expand Up @@ -50,8 +51,6 @@ module.exports = {
}),
nodeResolve(),
commonjs(),
babel({
plugins: ['external-helpers'],
}),
babel(),
],
};
12 changes: 0 additions & 12 deletions test/.eslintrc

This file was deleted.

0 comments on commit d776884

Please sign in to comment.