Skip to content

Commit f19dd82

Browse files
committed
Separate into browser.js and index.js
1 parent dad92a3 commit f19dd82

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

browser.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import Codeplus from ".";
2+
3+
// Make accesible to the browser window
4+
window.Codeplus = Codeplus;

example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>Document</title>
8-
<script src="./dist/codeplus.js"></script>
8+
<script src="./dist/browser.js"></script>
99
<script>
1010
window.addEventListener('load', function() {
1111
new Codeplus({

codeplus.js renamed to index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,4 +361,4 @@ class Codeplus {
361361
}
362362
}
363363

364-
window.Codeplus = Codeplus;
364+
export default Codeplus;

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
"license": "MIT",
66
"description": "Make your code elements interactive.",
77
"files": [
8-
"dist"
8+
"dist",
9+
"index.js"
910
],
1011
"scripts": {
11-
"build": "rm -rf dist && parcel build codeplus.js",
12-
"watch": "parcel watch codeplus.js",
13-
"format": "prettier --write codeplus.js",
12+
"build": "rm -rf dist && parcel build browser.js",
13+
"watch": "parcel watch browser.js",
14+
"format": "prettier --write browser.js",
1415
"pre-commit": "prettier --check *.js"
1516
},
1617
"devDependencies": {

0 commit comments

Comments
 (0)