diff --git a/js/entry2.js b/js/entry2.js index e91fa82..e3352e0 100644 --- a/js/entry2.js +++ b/js/entry2.js @@ -1,3 +1,5 @@ -var Apple2 = require('./main2'); +import { apple2 as _apple2 } from './main2'; +import * as UI from './ui/apple2'; -module.exports = { Apple2: Apple2 }; +export const Apple2 = UI; +export const apple2 = _apple2; diff --git a/js/entry2e.js b/js/entry2e.js index 35b2e71..e8016d1 100644 --- a/js/entry2e.js +++ b/js/entry2e.js @@ -1,3 +1,5 @@ -var Apple2 = require('./main2e'); +import { apple2 as _apple2 } from './main2e'; +import * as UI from './ui/apple2'; -module.exports = { Apple2: Apple2 }; +export const Apple2 = UI; +export const apple2 = _apple2; diff --git a/package.json b/package.json index 4c8e976..3f41262 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "typescript": "^4.1.3", "webpack": "^5.28.0", "webpack-cli": "^4.5.0", - "webpack-dev-server": "^3.11.0" + "webpack-dev-server": "^4.0.0-beta.1" }, "dependencies": { "apple2shader": "whscullin/apple2shader#f42252d8c2ad7055e3e5f5c39e235a710804e7a6", diff --git a/webpack.config.js b/webpack.config.js index f6e9fdb..68e1320 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,23 +3,31 @@ const path = require('path'); module.exports = { devtool: 'source-map', + mode: 'development', entry: { main2: path.resolve('js/entry2.js'), main2e: path.resolve('js/entry2e.js') }, output: { path: path.resolve('dist/'), - library: 'Apple2', - libraryExport: 'Apple2', - libraryTarget: 'var' + library: { + name: 'Apple2', + type: 'umd', + export: 'Apple2', + }, }, devServer: { compress: true, - publicPath: '/dist/', - watchContentBase: true, - watchOptions: { - ignored: ['**/node_modules/', '**/.git/'] - } + static: { + watch: false, + directory: __dirname, + }, + dev: { + publicPath: '/dist/', + }, + // watchContentBase: true, + // watchOptions: { + // ignored: ['**/node_modules/', '**/.git/'] }, module: { rules: [