You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your Readme shows how to make toDates work using a modified webpack.config.js.
That would require that I run "eject" on my React project, which is not recommended by just about everyone everywhere, and I'd rather not do it...
As an alternative I am using craco for overriding the configuration of the project.
I tried adding the code from your webpack.config.js to my craco.config.js in a few ways, but it had no effect at all.
I always get this error, both with and without the added config code:
ERROR in ./src/pages/Page.tsx 31:4-11
export 'toDates' (imported as 'toDates') was not found in 'ts-transformer-dates' (possible exports: __esModule, applyToDates, toDatesByArray)"
Below is what my craco.config.js attempts look like. Both attempts do nothing, the above error appears with or without it.
If you could provide code for craco.config.js that makes this work, I would be very grateful!
Attempt # 1:
const datesTransformer = require('ts-transformer-dates/lib/transformer').default;
module.exports = {
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader', // or 'awesome-typescript-loader'
options: {
// make sure not to set `transpileOnly: true` here, otherwise it will not work
getCustomTransformers: program => ({
before: [datesTransformer(program)]
})
}
}
]
}
}
Attempt # 2, this uses a webpack property that I saw being used somewhere, but that also has no effect at all:
const datesTransformer = require('ts-transformer-dates/lib/transformer').default;
module.exports = {
webpack: { // <--- extra property level
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader', // or 'awesome-typescript-loader'
options: {
// make sure not to set `transpileOnly: true` here, otherwise it will not work
getCustomTransformers: program => ({
before: [datesTransformer(program)]
})
}
}
]
}
}
}
The text was updated successfully, but these errors were encountered:
Your Readme shows how to make
toDates
work using a modifiedwebpack.config.js
.That would require that I run "eject" on my React project, which is not recommended by just about everyone everywhere, and I'd rather not do it...
As an alternative I am using craco for overriding the configuration of the project.
I tried adding the code from your
webpack.config.js
to mycraco.config.js
in a few ways, but it had no effect at all.I always get this error, both with and without the added config code:
Below is what my
craco.config.js
attempts look like. Both attempts do nothing, the above error appears with or without it.If you could provide code for
craco.config.js
that makes this work, I would be very grateful!Attempt # 1:
Attempt # 2, this uses a
webpack
property that I saw being used somewhere, but that also has no effect at all:The text was updated successfully, but these errors were encountered: