diff --git a/.babelrc b/.babelrc index 2965585ef6..1cd1fa1356 100644 --- a/.babelrc +++ b/.babelrc @@ -3,15 +3,10 @@ "retainLines": true, "presets": [], "ignore": [ - "resource/require.js", "chrome/content/zotero/include.js", "chrome/content/zotero/xpcom/citeproc.js", - "resource/csl-validator.js", - "resource/jspath.js", "resource/react.js", "resource/react-dom.js", - "resource/bluebird.js", - "resource/bluebird/*.js", "test/resource/*.js" ], "plugins": [ diff --git a/scripts/config.js b/scripts/config.js index 3687bbc8fa..31809baa31 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -3,16 +3,15 @@ const dirs = [ 'chrome', 'components', 'defaults', - 'resource', 'test', 'test/resource/chai', 'test/resource/chai-as-promised', 'test/resource/mocha' ]; -// list of folders from which all files are symlinked +// list of folders that are symlinked const symlinkDirs = [ - 'resource/tinymce', + 'chrome/content/zotero/xpcom/rdf', 'styles', 'translators' ]; @@ -25,7 +24,14 @@ const copyDirs = [ // list of files from root folder to symlink const symlinkFiles = [ - 'chrome.manifest', 'install.rdf', 'update.rdf' + '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', + 'update.rdf' ]; @@ -54,7 +60,10 @@ const jsFiles = [ `{${dirs.join(',')}}/**/*.js`, `{${dirs.join(',')}}/**/*.jsx`, `!{${symlinkDirs.concat(copyDirs).join(',')}}/**/*.js`, - `!{${symlinkDirs.concat(copyDirs).join(',')}}/**/*.jsx` + `!{${symlinkDirs.concat(copyDirs).join(',')}}/**/*.jsx`, + // Special handling for React -- see note above + 'resource/react.js', + 'resource/react-dom.js', ]; const scssFiles = [