gotelem/web/webpack.common.js
saji 9e9081fa4a
Some checks failed
Go / build (1.21) (push) Successful in 1m7s
Go / build (1.22) (push) Successful in 1m5s
Node.js CI / build (push) Failing after 1m37s
fix unused dotenv plugin
2024-03-08 21:55:15 -06:00

40 lines
968 B
JavaScript

import path from 'path';
import {fileURLToPath} from 'url';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import CopyPlugin from 'copy-webpack-plugin';
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 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