Replies: 6 comments 2 replies
-
Thanks so much for filing this issue, and for using True Myth! |
Beta Was this translation helpful? Give feedback.
-
Interesting. 🤔 Are your webpack and ts-loader configs set up to handle Node 14+ and TypeScript 4.7+ |
Beta Was this translation helpful? Give feedback.
-
import {join, dirname} from "path";
import {fileURLToPath} from "url";
import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin";
function cwd(path) {
return fileURLToPath(join(dirname(import.meta.url), path));
}
export default {
mode: "production",
context: cwd("true-myth"),
entry: "./src/public/index.ts",
module: {
rules: [{
test: /\.ts$/,
loader: "ts-loader",
options: {transpileOnly: true},
exclude: /node_modules/
}],
},
resolve: {extensions: [".ts", ".js"]},
output: {
path: cwd("src"),
filename: "true-myth.js"
},
plugins: [new ForkTsCheckerWebpackPlugin({typescript: {configFile: "./ts/publish.tsconfig.json"}})]
}; this is my |
Beta Was this translation helpful? Give feedback.
-
BTW, this package also seems incompatible with parcel: $ npx parcel build true-myth/src/public/index.ts
× Build failed.
@parcel/core: Multiple targets have the same destination path "dist\public\index.js"
C:\..\true-myth\package.json:24:11
23 | "type": "module",
> 24 | "main": "dist/public/index.js",
> | ^^^^^^^^^^^^^^^^^^^^^^
> 25 | "module": "dist/public/index.js",
> | ^^^^^^^^^^^^^^^^^^^^^^
26 | "exports": {
27 | ".": "./dist/public/index.js",
ℹ Try removing the duplicate targets, or changing the destination paths. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the delay here, been busy. The way you're importing it in the webpack and Parcel examples is wrong: You should not be trying to build the source with Parcel in a consuming app, and it isn't configured to be built with Parcel (it has its own fairly simple The way to use it in another package, though, is just to import Maybe from 'true-myth/maybe';
import Result from 'true-myth/result'; |
Beta Was this translation helpful? Give feedback.
-
I am unable to bundle with microbundle, which doesn't really have configuration options. Here is the repo: https://github.com/DaviDevMod/focus-trap/tree/dev/packages/focus-trap When trying to build, I get:
If it's relevant, I have a Next.js app consuming the package (and not using true-myth) which builds just fine. I am aware of these requirements which are all met by my setup, while removing How can I get to build my package using true-myth? |
Beta Was this translation helpful? Give feedback.
-
I'm trying to bundle this package into a single file using webpack & ts-loader, and it caught the below error. I'm unsure how to remedy it on my end, I think the package itself needs to be changed to work with webpack?
Beta Was this translation helpful? Give feedback.
All reactions