Open glothos opened 5 years ago
I found a solution. If you are using webpack to set an absolute path and you want to use this package, you can make it work by using babel-plugin-module-resolver
. Here is how your .babelrc
should look like:
{
"presets": [
"react",
[
"env",
{
"modules": "commonjs",
"targets": {
"browsers": ["last 2 versions"]
}
}
]
],
"plugins": [
"syntax-dynamic-import",
"transform-decorators-legacy",
"transform-object-rest-spread",
"transform-class-properties",
"react-hot-loader/babel",
"transform-es2015-block-scoping",
["transform-runtime", { "polyfill": false }],
["module-resolver", {
"cwd": "babelrc",
"root": ["./src"]
}]
],
"env": {
"development": {
"plugins": [
"react-hot-loader/babel"
]
}
}
}
Now I got the window issue. Wherever I use window
object it says window is not defined. If I find a workaround I will post here.
@glothos sorry, i not saw your issue. You were able to deal with the problem window
object?
Not really, problem still persists. I tried some other approaches like defining window object, I managed to skip that problem but I couldn't make it work with my current structure which I don't think it's related to this package.
Hi there, first of all thanks for maintaining this package for so long.
I'm using webpack for this project and I've been trying to create its sitemap. I'm getting this error when running script to build the sitemap:
"sitemap:create": "node ./src/sitemap-builder.js",
Here's my router file:
and here's
sitemap-builder.js
For some reason I get this error:
This components folder is related to the components I import in router.js file. I'm pretty sure I'm missing some basic stuff here. I replaced
... from 'components'
(set by webpack) to relative path... from './components
with no luck.Thanks in advance.