This repository has been archived by the owner on Sep 7, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efb428a
commit eb2af23
Showing
4 changed files
with
3 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1 @@ | ||
const webpackConfig = require('./webpack.config'); | ||
const sauceBrowsers = require('./sauce.browsers'); | ||
|
||
module.exports = function (config) { | ||
// list of files / patterns to load in the browser | ||
// all dependancies should be traced through here | ||
var files = ['test/unit.js']; | ||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
// webpack will trace and watch all dependancies | ||
var preprocessors = { | ||
'test/unit.js': [ 'webpack', 'sourcemap' ] | ||
}; | ||
|
||
if (process.argv.indexOf('--perf') > -1) { | ||
files = [ require.resolve('../benchmark/benchmark.js'), 'test/perf.js' ]; | ||
preprocessors = { | ||
'test/perf.js': [ 'webpack', 'sourcemap' ] | ||
}; | ||
} | ||
|
||
config.set(Object.assign({ | ||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
// setting to process.cwd will make all paths start in current component directory | ||
basePath: process.cwd(), | ||
|
||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: [ 'mocha', 'chai', 'sinon-chai' ], | ||
|
||
// list of files / patterns to load in the browser | ||
files: files, | ||
|
||
// list of files to exclude | ||
exclude: [], | ||
|
||
// list of preprocessors | ||
preprocessors: preprocessors, | ||
|
||
// karma watches the test entry points | ||
// (you don't need to specify the entry option) | ||
// webpack watches dependencies | ||
webpack: Object.assign({}, webpackConfig, { | ||
devtool: 'inline-source-map', | ||
entry: undefined | ||
}), | ||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: [ 'progress' ], | ||
|
||
// web server port | ||
port: 9876, | ||
|
||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
|
||
// level of logging | ||
// possible values: LOG_DISABLE, LOG_ERROR, LOG_WARN, LOG_INFO, 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: [ 'Chrome', 'Firefox' ], | ||
|
||
// 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 | ||
}, process.argv.indexOf('--saucelabs') === -1 ? {} : { | ||
sauceLabs: { | ||
testName: 'Unit Tests', | ||
recordScreenshots: false, | ||
connectOptions: { verbose: true } | ||
}, | ||
customLaunchers: sauceBrowsers, | ||
browsers: Object.keys(sauceBrowsers), | ||
captureTimeout: 120000, | ||
reporters: [ 'saucelabs', 'dots' ], | ||
autoWatch: false, | ||
concurrency: 5, | ||
client: {} | ||
})); | ||
}; | ||
module.exports = require('skatejs-build/karma.conf'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1 @@ | ||
const rollupBabel = require('rollup-plugin-babel'); | ||
const rollupCommonjs = require('rollup-plugin-commonjs'); | ||
const rollupNodeResolve = require('rollup-plugin-node-resolve'); | ||
const rollupUglify = require('rollup-plugin-uglify'); | ||
const path = require('path'); | ||
const pkg = require(path.join(process.cwd(), 'package.json')); | ||
const shouldMinify = process.argv.indexOf('--min') !== -1; | ||
const presetEs2015 = require('babel-preset-es2015-rollup'); | ||
const babel = rollupBabel({ | ||
presets: presetEs2015, | ||
}); | ||
const plugins = [ | ||
babel, | ||
rollupCommonjs(), | ||
rollupNodeResolve(), | ||
]; | ||
|
||
if (shouldMinify) { | ||
plugins.push(rollupUglify()); | ||
} | ||
|
||
const entry = pkg['jsnext:main'] || pkg.main || 'src/index.js'; | ||
const moduleName = pkg['build:global'] || pkg.name; | ||
|
||
module.exports = { | ||
dest: 'dist/index' + (shouldMinify ? '.min' : '') + '.js', | ||
entry, | ||
exports: 'named', | ||
format: 'umd', | ||
moduleName, | ||
plugins, | ||
sourceMap: true, | ||
useStrict: false, | ||
}; | ||
module.exports = require('skatejs-build/rollup.config'); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1 @@ | ||
var camelCase = require('camelcase'); | ||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
var pkg = require(path.join(process.cwd(), 'package.json')); | ||
var shouldMininimize = process.argv.indexOf('--min') !== -1; | ||
var standardConfig = { | ||
entry: { | ||
'dist/bundle.js': './src/index.js' | ||
}, | ||
output: { | ||
path: './', | ||
filename: '[name]', | ||
libraryTarget: 'umd', | ||
library: camelCase(pkg.name), | ||
sourceMapFilename: '[file].map' | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /\.css$/, | ||
loader: 'style!css' | ||
}, { | ||
test: /\.less$/, | ||
loader: 'style!css!less' | ||
}, { | ||
loader: 'babel-loader', | ||
test: /\.js$/, | ||
query: { | ||
presets: ['babel-preset-es2015', 'babel-preset-react'] | ||
} | ||
}] | ||
}, | ||
plugins: [ | ||
new webpack.optimize.UglifyJsPlugin({ | ||
include: /\.min\.js$/, | ||
minimize: true | ||
}) | ||
] | ||
}; | ||
|
||
if (shouldMininimize) { | ||
Object.assign(standardConfig.entry, { | ||
'dist/bundle.min.js': './src/index.js' | ||
}); | ||
} | ||
|
||
module.exports = standardConfig; | ||
module.exports = require('skatejs-build/webpack.config'); |