gotelem/web/webpack.config.js
saji 8b8619dd8a
All checks were successful
Go / build (1.21) (push) Successful in 1m17s
Go / build (1.22) (push) Successful in 1m15s
added openmct plugin and embedding
2024-03-03 23:04:41 -06:00

48 lines
1.2 KiB
JavaScript

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require("copy-webpack-plugin");
const Dotenv = require('dotenv-webpack');
module.exports = {
entry: './src/app.js',
mode: "development",
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/index.html',
filename: 'index.html',
}),
new Dotenv(),
new CopyPlugin({
patterns: [
{ from: "**/*", to: "openmct/", context: "node_modules/openmct/dist"},
]
})
],
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
externals: {
openmct: "openmct",
},
devServer: {
static: [{
// eslint-disable-next-line no-undef
directory: path.join(__dirname, '/node_modules/openmct/dist'),
publicPath: '/node_modules/openmct/dist'
}]
},
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
};