2024-03-08 23:08:43 +00:00
|
|
|
import path from 'path';
|
|
|
|
import {fileURLToPath} from 'url';
|
|
|
|
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
|
|
import CopyPlugin from 'copy-webpack-plugin';
|
|
|
|
import DotenvWebpackPlugin from 'dotenv-webpack';
|
2024-03-04 05:04:41 +00:00
|
|
|
|
2024-03-08 23:08:43 +00:00
|
|
|
const config = {
|
|
|
|
entry: './src/app.ts',
|
2024-03-04 05:04:41 +00:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
use: 'ts-loader',
|
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: 'src/index.html',
|
|
|
|
filename: 'index.html',
|
|
|
|
}),
|
2024-03-08 23:08:43 +00:00
|
|
|
new DotenvWebpackPlugin(),
|
2024-03-04 05:04:41 +00:00
|
|
|
new CopyPlugin({
|
|
|
|
patterns: [
|
|
|
|
{ from: "**/*", to: "openmct/", context: "node_modules/openmct/dist"},
|
|
|
|
]
|
|
|
|
})
|
|
|
|
],
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.tsx', '.ts', '.js'],
|
|
|
|
},
|
|
|
|
externals: {
|
|
|
|
openmct: "openmct",
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
filename: 'main.js',
|
2024-03-08 23:08:43 +00:00
|
|
|
path: path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'dist'),
|
2024-03-04 05:04:41 +00:00
|
|
|
},
|
|
|
|
};
|
2024-03-08 23:08:43 +00:00
|
|
|
|
|
|
|
export default config
|