Skip to content

Commit ea4b4ed

Browse files
committed
Transpile javascript files using babel
1 parent c00562f commit ea4b4ed

File tree

4 files changed

+200
-7
lines changed

4 files changed

+200
-7
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@ typings/
6161
.next
6262
node_modules/
6363
build/
64+
dist/
6465
yarn.lock
65-
.vscode/
66+
.vscode/

package-lock.json

Lines changed: 183 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dicom-microscopy-viewer",
3-
"version": "0.36.2",
3+
"version": "0.36.3",
44
"description": "Interactive web-based viewer for DICOM Microscopy Images",
55
"main": "./src/dicom-microscopy-viewer.js",
66
"standard": {
@@ -24,11 +24,11 @@
2424
"build": "webpack --mode=development",
2525
"build:prod": "webpack --mode=production",
2626
"prepublishOnly": "npm run build:prod",
27-
"generateStaticSite": "npm run build:prod && cp -R ./build ./examples",
27+
"generateStaticSite": "npm run build:prod && cp -R ./dist ./examples",
2828
"generateDocs": "jsdoc -c ./jsdoc_conf.json",
2929
"fmt": "standard 'src/**/.js' --fix",
3030
"lint": "standard 'src/**/*.js'",
31-
"clean": "rm -rf ./build ./dist ./node_modules"
31+
"clean": "rm -rf ./dist ./node_modules"
3232
},
3333
"repository": {
3434
"type": "git",
@@ -50,6 +50,7 @@
5050
"@babel/core": "7.17",
5151
"@babel/preset-env": "7.16",
5252
"babel-jest": "27.5",
53+
"babel-loader": "^8.2.3",
5354
"css-loader": "^6.6",
5455
"jest": "^27.5",
5556
"jest-canvas-mock": "^2.3",

webpack.config.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const path = require('path')
33
const config = {
44
entry: path.resolve(__dirname, 'src/dicom-microscopy-viewer.js'),
55
output: {
6-
path: path.resolve(__dirname, 'build'),
6+
path: path.resolve(__dirname, 'dist'),
77
filename: 'dicom-microscopy-viewer.js',
88
library: {
99
name: 'DICOMMicroscopyViewer',
@@ -17,6 +17,16 @@ const config = {
1717
{
1818
test: /\.css$/,
1919
use: 'css-loader'
20+
},
21+
{
22+
test: /\.m?js$/,
23+
exclude: /(node_modules)/,
24+
use: {
25+
loader: 'babel-loader',
26+
options: {
27+
presets: ['@babel/preset-env']
28+
}
29+
}
2030
}
2131
]
2232
},

0 commit comments

Comments
 (0)