Skip to content

Commit

Permalink
Merge pull request #13 from wcastand/master
Browse files Browse the repository at this point in the history
Allow to use jsx
  • Loading branch information
developit authored Dec 13, 2017
2 parents 086e10b + cbcdf6a commit 5f3e988
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules
build
dist
package-lock.json
yarn.lock
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"author": "Jason Miller <jason@developit.ca> (http://jasonformat.com)",
"license": "MIT",
"dependencies": {
"acorn-jsx": "4.1.0",
"asyncro": "^2.0.1",
"babel-polyfill": "^6.26.0",
"chalk": "^2.3.0",
Expand Down
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default async function microbundle(options) {
options.pkg.name = basename(options.cwd);
console.warn(chalk.yellow(`${chalk.yellow.inverse('WARN')} missing package.json "name" field. Assuming "${options.pkg.name}".`));
}

options.input = [].concat(
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
).map( file => resolve(cwd, file) );
Expand Down Expand Up @@ -176,6 +176,11 @@ function createConfig(options, entry, format) {
promises: true,
transformations: {
forOf: false
},
parser: {
plugins: {
jsx: require('acorn-jsx')
}
}
}),
buble({
Expand Down

0 comments on commit 5f3e988

Please sign in to comment.