2017-06-20 23:18:46 +00:00
|
|
|
// list of folders from where .js files are compiled and non-js files are symlinked
|
|
|
|
const dirs = [
|
|
|
|
'chrome',
|
|
|
|
'components',
|
|
|
|
'defaults',
|
|
|
|
'test',
|
|
|
|
'test/resource/chai',
|
|
|
|
'test/resource/chai-as-promised',
|
|
|
|
'test/resource/mocha'
|
|
|
|
];
|
|
|
|
|
2019-03-20 08:39:33 +00:00
|
|
|
// list of folders that are symlinked
|
2017-06-20 23:18:46 +00:00
|
|
|
const symlinkDirs = [
|
2019-03-20 08:39:33 +00:00
|
|
|
'chrome/content/zotero/xpcom/rdf',
|
2017-06-20 23:18:46 +00:00
|
|
|
'styles',
|
|
|
|
'translators'
|
|
|
|
];
|
|
|
|
|
|
|
|
// list of folders which are copied to the build folder
|
|
|
|
const copyDirs = [
|
|
|
|
'test/tests/data' // browser follows symlinks when loading test data
|
|
|
|
// triggering false-positive test results with mismatched URIs
|
|
|
|
];
|
|
|
|
|
|
|
|
// list of files from root folder to symlink
|
|
|
|
const symlinkFiles = [
|
2019-03-20 08:39:33 +00:00
|
|
|
'chrome.manifest',
|
|
|
|
'install.rdf',
|
|
|
|
// React needs to be patched by babel-worker.js, so symlink all files in resource/ except for
|
|
|
|
// those. Babel transpilation for React is still disabled in .babelrc.
|
|
|
|
'resource/**/*',
|
|
|
|
'!resource/react.js',
|
|
|
|
'!resource/react-dom.js',
|
2019-03-28 09:19:41 +00:00
|
|
|
'!resource/react-virtualized.js',
|
2019-03-20 08:39:33 +00:00
|
|
|
'update.rdf'
|
2017-06-20 23:18:46 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
// these files will be browserified during the build
|
|
|
|
const browserifyConfigs = [
|
2018-02-25 20:07:33 +00:00
|
|
|
{
|
|
|
|
src: 'node_modules/url/url.js',
|
|
|
|
dest: 'resource/url.js',
|
|
|
|
config: {
|
|
|
|
standalone: 'url'
|
|
|
|
}
|
|
|
|
},
|
2017-06-20 23:18:46 +00:00
|
|
|
{
|
|
|
|
src: 'node_modules/sinon/lib/sinon.js',
|
|
|
|
dest: 'test/resource/sinon.js',
|
|
|
|
config: {
|
|
|
|
standalone: 'sinon'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: 'node_modules/chai-as-promised/lib/chai-as-promised.js',
|
|
|
|
dest: 'test/resource/chai-as-promised.js',
|
|
|
|
config: {
|
|
|
|
standalone: 'chaiAsPromised'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
// exclude mask used for js, copy, symlink and sass tasks
|
2017-05-22 23:10:03 +00:00
|
|
|
const ignoreMask = ['**/#*', '**/_*.scss'];
|
2017-06-20 23:18:46 +00:00
|
|
|
|
|
|
|
const jsFiles = [
|
|
|
|
`{${dirs.join(',')}}/**/*.js`,
|
2017-05-22 23:10:03 +00:00
|
|
|
`{${dirs.join(',')}}/**/*.jsx`,
|
|
|
|
`!{${symlinkDirs.concat(copyDirs).join(',')}}/**/*.js`,
|
2019-03-20 08:39:33 +00:00
|
|
|
`!{${symlinkDirs.concat(copyDirs).join(',')}}/**/*.jsx`,
|
|
|
|
// Special handling for React -- see note above
|
|
|
|
'resource/react.js',
|
|
|
|
'resource/react-dom.js',
|
2019-03-28 09:19:41 +00:00
|
|
|
'resource/react-virtualized.js',
|
2017-05-22 23:10:03 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
const scssFiles = [
|
|
|
|
'scss/**/*.scss',
|
|
|
|
'chrome/skin/default/zotero/**/*.scss'
|
2017-06-20 23:18:46 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
module.exports = {
|
2017-05-22 23:10:03 +00:00
|
|
|
dirs, symlinkDirs, copyDirs, symlinkFiles, browserifyConfigs, jsFiles, scssFiles, ignoreMask
|
2018-03-01 23:18:37 +00:00
|
|
|
};
|