-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from tonysamperi/v5-webpack
V5 webpack
- Loading branch information
Showing
13 changed files
with
754 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# To learn more about how to use Nix to configure your environment | ||
# see: https://developers.google.com/idx/guides/customize-idx-env | ||
{ pkgs, ... }: { | ||
# Which nixpkgs channel to use. | ||
channel = "stable-23.11"; # or "unstable" | ||
|
||
# Use https://search.nixos.org/packages to find packages | ||
packages = [ | ||
# pkgs.go | ||
# pkgs.python311 | ||
# pkgs.python311Packages.pip | ||
pkgs.nodejs_20 | ||
pkgs.nodePackages.yarn | ||
]; | ||
|
||
# Sets environment variables in the workspace | ||
env = { }; | ||
idx = { | ||
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" | ||
extensions = [ | ||
# "vscodevim.vim" | ||
]; | ||
|
||
# Enable previews | ||
previews = { | ||
enable = true; | ||
previews = { | ||
# web = { | ||
# # Example: run "npm run dev" with PORT set to IDX's defined port for previews, | ||
# # and show it in IDX's web preview panel | ||
# command = ["npm" "run" "dev"]; | ||
# manager = "web"; | ||
# env = { | ||
# # Environment variables to set for your server | ||
# PORT = "$PORT"; | ||
# }; | ||
# }; | ||
}; | ||
}; | ||
|
||
# Workspace lifecycle hooks | ||
workspace = { | ||
# Runs when a workspace is first created | ||
onCreate = { | ||
# Example: install JS dependencies from NPM | ||
# npm-install = "npm install"; | ||
}; | ||
# Runs when the workspace is (re)started | ||
onStart = { | ||
# Example: start a background task to watch and re-build backend code | ||
# watch-backend = "npm run watch-backend"; | ||
}; | ||
}; | ||
}; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as tsLuxon from "../dist/ts-luxon.umd.js"; | ||
import pkg from "../package.json" assert { type: "json" }; | ||
|
||
(() => { | ||
if (pkg.version !== tsLuxon.VERSION) { | ||
console.error(`Version mismatch! Expected ${pkg.version}, got ${tsLuxon.VERSION}. Rebuild the package to solve!`) | ||
throw new Error(`PGK-LIB VERSION MISMATCH!`); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": [ | ||
"./tsconfig.json" | ||
], | ||
"compilerOptions": { | ||
"module": "CommonJS", | ||
"target": "esnext", | ||
"moduleResolution": "node", | ||
"lib": [ | ||
"esnext" | ||
], | ||
"outDir": "dist" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const { resolve } = require("path"); | ||
const webpackCommon = require("./webpack.common"); | ||
|
||
webpackCommon.module.rules.push({ | ||
test: /\.tsx?$/, | ||
use: { | ||
loader: 'ts-loader', | ||
options: { | ||
configFile: "tsconfig.cjs.json" | ||
} | ||
}, | ||
exclude: /node_modules/ | ||
}); | ||
|
||
module.exports = { | ||
...webpackCommon, | ||
entry: { | ||
'ts-luxon.cjs': './src/index.ts' | ||
}, | ||
experiments: { | ||
outputModule: true, | ||
}, | ||
output: { | ||
path: resolve('dist'), | ||
globalObject: "this", | ||
filename: '[name].js', | ||
library: { | ||
type: "module" | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const { version } = require("./package.json"); | ||
|
||
// from "(.*?)(?<!\.js)"; | ||
|
||
module.exports = { | ||
mode: "development", | ||
optimization: { | ||
minimize: false | ||
}, | ||
resolve: { | ||
extensions: ['.ts', ".js"] | ||
}, | ||
devtool: 'source-map', | ||
resolve: { | ||
// Add `.ts` and `.tsx` as a resolvable extension. | ||
extensions: [".ts", ".tsx", ".js"], | ||
// Add support for TypeScripts fully qualified ESM imports. | ||
extensionAlias: { | ||
".js": [".js", ".ts"], | ||
".mjs": [".mjs", ".mts"] | ||
} | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.m?[jt]s$/, | ||
loader: 'string-replace-loader', | ||
options: { | ||
search: "__BUILD_VRS__", | ||
replace: version, | ||
} | ||
}, | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const { resolve } = require("path"); | ||
const webpackCommon = require("./webpack.common"); | ||
|
||
webpackCommon.module.rules.push({ | ||
test: /\.tsx?$/, | ||
use: 'ts-loader', | ||
exclude: /node_modules/, | ||
}); | ||
|
||
module.exports = { | ||
...webpackCommon, | ||
entry: { | ||
'ts-luxon.umd': './src/index.ts' | ||
}, | ||
output: { | ||
path: resolve('dist'), | ||
globalObject: "this", | ||
filename: '[name].js', | ||
library: { | ||
type: "umd", | ||
name: "tsLuxon" | ||
}, | ||
umdNamedDefine: true | ||
} | ||
}; |
Oops, something went wrong.