mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
/**
|
|
* Base webpack config used across other specific configs
|
|
*/
|
|
|
|
import webpack from "webpack";
|
|
import webpackPaths from "./webpack.paths";
|
|
import { dependencies as externals } from "../../release/app/package.json";
|
|
|
|
const configuration: webpack.Configuration = {
|
|
externals: [...Object.keys(externals || {})],
|
|
|
|
stats: "errors-only",
|
|
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.[jt]sx?$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: "ts-loader",
|
|
options: {
|
|
// Remove this line to enable type checking in webpack builds
|
|
transpileOnly: true,
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
|
|
output: {
|
|
path: webpackPaths.srcPath,
|
|
// https://github.com/webpack/webpack/issues/1114
|
|
library: {
|
|
type: "commonjs2",
|
|
},
|
|
},
|
|
|
|
/**
|
|
* Determine the array of extensions that should be used to resolve modules.
|
|
*/
|
|
resolve: {
|
|
extensions: [".js", ".jsx", ".json", ".ts", ".tsx"],
|
|
modules: [webpackPaths.srcPath, "node_modules"],
|
|
},
|
|
|
|
plugins: [
|
|
new webpack.EnvironmentPlugin({
|
|
NODE_ENV: "production",
|
|
}),
|
|
],
|
|
};
|
|
|
|
export default configuration;
|