-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for arbitrary compile-to-JS languages (#732)
- removed coffee-script, coffee-loader and node-cjsx modules from package.json - removed .coffee and .cjsx from default Webpack config - added two new API hooks: - resolvableExtensions() enables the program to resolve additional extensions as source files. By default, this array consists of [ '.js', '.jsx'] - preprocessSource() enables the program to compile pages and layouts to JS before attempting to generate query information. - when attempting to parse the source of a transpiled-to-JS file, the first parseable source returned by a plugin will be used to collect page queries (i.e., first plugin wins) - an ExportNamedDeclaration visitor is now used to acquire the pageQuery export, allowing for page queries expressed either as TemplateLiterals (i.e., ES6/TypeScript) or StringLiterals (i.e., CoffeeScript). Note that an ExportNamedDeclaration (i.e., ES6 export) must be used for this pageQuery export. Both TypeScript and CoffeeScript (2.x) support this syntax. A more traditional, CommonJS-style module.exports.pageQuery will not work.
- Loading branch information
1 parent
e4db6cb
commit 41c5ce6
Showing
5 changed files
with
119 additions
and
163 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
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
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
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
Oops, something went wrong.