Skip to content

Commit

Permalink
Merge pull request #71 from nikolaik/fix/webpack-warning
Browse files Browse the repository at this point in the history
Switch to esbuild from parcel-bundler
  • Loading branch information
kadikraman authored Feb 14, 2021
2 parents ce791ab + afeb87e commit acff504
Show file tree
Hide file tree
Showing 5 changed files with 357 additions and 4,552 deletions.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

5 changes: 2 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
example
index.html
demo
test
.eslintrc.js
.travis.yml
.github
index.js
19 changes: 19 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const esbuild = require('esbuild');
const pkg = require('./package.json');

const options = {
entryPoints: ['src/index.js'],
bundle: true,
minify: true,
sourcemap: true,
external: ['path']
};
(async () => {
await esbuild
.build({ ...options, outfile: pkg.main, format: 'cjs' })
.catch(() => process.exit(1));

await esbuild
.build({ ...options, outfile: pkg.module, format: 'esm' })
.catch(() => process.exit(1));
})();
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
"version": "1.4.2",
"description": "Converter for converting Draft.js state into Markdown and vice versa",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "index.d.ts",
"license": "MIT",
"engines": {
"node": ">=6.0.0"
"node": ">=10.0.0"
},
"scripts": {
"lint": "$(npm bin)/eslint src test",
"test": "$(npm bin)/mocha && npm run lint",
"test-dev": "$(npm bin)/mocha --compilers js:babel-register --watch",
"test-brk": "$(npm bin)/mocha --debug-brk",
"compile": "rm -rf dist && mkdir dist && parcel build src/index.js",
"compile": "rm -rf dist && mkdir dist && node build.js",
"prepublish": "npm run compile",
"precommit": "lint-staged",
"deploy-demo": "cd demo && yarn build && gh-pages -d build"
Expand Down Expand Up @@ -43,11 +44,8 @@
},
"homepage": "https://kadikraman.github.io/draftjs-md-converter",
"devDependencies": {
"babel-core": "^6.26.3",
"babel-eslint": "10.0.3",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-register": "6.26.0",
"@babel/core": "7.11.6",
"babel-eslint": "^10.1.0",
"chai": "^3.5.0",
"dirty-chai": "^1.2.2",
"eslint": "^3.9.0",
Expand All @@ -60,7 +58,7 @@
"husky": "4.2.1",
"lint-staged": "^7.0.4",
"mocha": "^2.4.5",
"parcel-bundler": "1.12.4",
"esbuild": "0.8.36",
"prettier": "1.19.1"
},
"dependencies": {
Expand All @@ -71,4 +69,4 @@
"pre-commit": "lint-staged"
}
}
}
}
Loading

0 comments on commit acff504

Please sign in to comment.