Skip to content

Commit 703b804

Browse files
committed
add acorn-jsx as a dependency and allow nodent to handle jsx
1 parent 9e2e4e9 commit 703b804

3 files changed

Lines changed: 2900 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"author": "Jason Miller <jason@developit.ca> (http://jasonformat.com)",
3333
"license": "MIT",
3434
"dependencies": {
35+
"acorn-jsx": "4.1.0",
3536
"asyncro": "^2.0.1",
3637
"babel-polyfill": "^6.26.0",
3738
"chalk": "^2.3.0",

src/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default async function microbundle(options) {
4545
options.pkg.name = basename(options.cwd);
4646
console.warn(chalk.yellow(`${chalk.yellow.inverse('WARN')} missing package.json "name" field. Assuming "${options.pkg.name}".`));
4747
}
48-
48+
4949
options.input = [].concat(
5050
options.entries && options.entries.length ? options.entries : options.pkg.source || (await isDir(resolve(cwd, 'src')) && 'src/index.js') || (await isFile(resolve(cwd, 'index.js')) && 'index.js') || options.pkg.module
5151
).map( file => resolve(cwd, file) );
@@ -176,6 +176,11 @@ function createConfig(options, entry, format) {
176176
promises: true,
177177
transformations: {
178178
forOf: false
179+
},
180+
parser: {
181+
plugins: {
182+
jsx: require('acorn-jsx')
183+
}
179184
}
180185
}),
181186
buble({

0 commit comments

Comments
 (0)