Testing of the apollo react (hooks based) client with the Haunted webcomponents library.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

6 years ago
const path = require("path");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const Dotenv = require('dotenv-webpack');
module.exports = {
target: "web",
module: {
rules: [
{
exclude: [/node_modules/],
test: /\.ts$/,
loader: "ts-loader",
options: { configFile: "tsconfig.web.json" },
},
{
test: /\.(css|scss)$/,
loader: "css-loader!sass-loader",
},
],
},
output: {
filename: "bundle.[name].js",
path: path.resolve(__dirname, "dist", "web"),
},
resolve: {
extensions: [".ts", ".js"],
alias: {
react: path.resolve(__dirname, "src/wrapper/apollo.js")
},
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({ template: './src/index.ejs' }),
new CopyWebpackPlugin([
'./node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js',
{ from: './node_modules/@webcomponents/webcomponentsjs/bundles', to: 'bundles' },
]),
new Dotenv(),
],
};