Skip to content

Commit

Permalink
change to named export
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubfiala committed Jan 9, 2023
1 parent 93d10d3 commit 25fda98
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Enjoy!
If you're using a tool like webpack or browserify to bundle your code, you can install it using npm.

- install atrament as a dependency using `npm install --save atrament`.
- You can access the Atrament class using `const Atrament = require('atrament');`
- You can access the Atrament class using `import { Atrament } from 'atrament';`

#### script tag

Expand All @@ -70,6 +70,8 @@ Thanks to [rubenstolk](https://github.com/rubenstolk), you can also use the [sc-
- in your JavaScript, create an `Atrament` instance passing it your canvas object:

```js
import { Atrament } from 'atrament';

const canvas = document.querySelector('#sketchpad');
const sketchpad = new Atrament(canvas);
```
Expand Down
2 changes: 1 addition & 1 deletion dist/atrament.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/atrament.min.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Atrament from './src/atrament.js';

export default Atrament;
// eslint-disable-next-line import/prefer-default-export
export { Atrament };
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "atrament",
"version": "2.0.0",
"description": "Tiny JS library for beautiful drawing and handwriting on the HTML Canvas",
"main": "index.js",
"main": "./dist/atrament.min.js",
"module": "./index.js",
"scripts": {
"build": "webpack --config webpack.config.js",
"watch": "webpack --config webpack.config.js --watch",
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
path: path.resolve('./dist'),
filename: 'atrament.min.js',
library: {
name: 'Atrament',
name: 'atrament',
type: 'umd',
},
},
Expand Down

0 comments on commit 25fda98

Please sign in to comment.