Skip to content

Instantly share code, notes, and snippets.

@wovalle
Last active October 10, 2024 21:21
Show Gist options
  • Save wovalle/c4db600348b34351e7c2cc219c0605f6 to your computer and use it in GitHub Desktop.
Save wovalle/c4db600348b34351e7c2cc219c0605f6 to your computer and use it in GitHub Desktop.
Safary build tooling
SAFARY_BACKEND_ORIGIN=https://tag.safary.club
npm_package_version=0.1.13
{
"compilerOptions": {
"target": "ES2015",
"module": "commonjs",
"moduleResolution": "node",
"lib": ["es5", "dom"],
"rootDir": "src",
"outDir": "lib",
"strict": true,
"alwaysStrict": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"downlevelIteration": true,
"declaration": true,
"pretty": true,
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["typings/**/*", "src/**/*", "test/**/*"],
"exclude": ["node_modules", "lib", "src/**/*.test.ts", "test"]
}
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: './src/index.ts',
devtool: false,
mode: 'production',
module: {
rules: [
{
test: /\.m?[j|t]s$/,
exclude: /(node_modules)/,
use: {
loader: 'swc-loader',
},
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: 'stag.js',
path: path.resolve(__dirname, 'lib'),
environment: {
arrowFunction: false,
},
},
plugins: [
new webpack.DefinePlugin({
'process.env.SAFARY_BACKEND_ORIGIN': JSON.stringify(
process.env.SAFARY_BACKEND_ORIGIN
),
'process.env.npm_package_version': JSON.stringify(
process.env.npm_package_version
),
}),
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment