gotelem/web/webpack.common.js
saji 4829dd50c7
All checks were successful
Go / build (1.21) (push) Successful in 1m5s
Go / build (1.22) (push) Successful in 1m4s
move openmct plugin to typescript
remove unused livestream test function
2024-03-08 17:08:43 -06:00

42 lines
1 KiB
JavaScript

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';
const config = {
entry: './src/app.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/index.html',
filename: 'index.html',
}),
new DotenvWebpackPlugin(),
new CopyPlugin({
patterns: [
{ from: "**/*", to: "openmct/", context: "node_modules/openmct/dist"},
]
})
],
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
externals: {
openmct: "openmct",
},
output: {
filename: 'main.js',
path: path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'dist'),
},
};
export default config