Comments (6)
I personally prefer~/* aswell. I don't really like using @
for aliasing because it collides with npm scopes
from remix.
Related #146
I see three choices to bikeshed:
import * from "@app/something"
import * from "@/something"
import * from "~/something"
I think I like ~/*
personally. It's pretty much the same thing as your home directory on a file system.
If we want to make it easier to migrate from next we'd support a list of aliases in remix.config like:
{
compiler: {
"base": "app",
"paths": {
"@/components/*": [ "components/*" ]
}
}
I don't like that much control personally, just make up your mind and do a relative import or a root import. Codebases with a bunch of configurable import aliases get confusing (I worked in a huge one), you look at an import statement and don't know where the heck anything is really coming from.
from remix.
I really like this idea, and I think I know exactly how we could implement it. So ~
in this case would just mean "the app
directory", right? Would it ever be useful to be able to refer to the project root directory?
from remix.
If you want for some reason to refer to the project root directory I think ~/../server
should work? Like in a CLI
from remix.
I'm good with it 👍 would make things much nicer since I can't colocate my files
from remix.
This was added in #253 and will be released in 0.18
from remix.
Related Issues (20)
- process.env.DATABASE_URL is hard coded after vite build and will that considered as leakage? HOT 1
- Environment variables not available in AWS ECS instance. HOT 2
- "Hydration failed ..." in standard vite template application HOT 4
- The import type { MetaFunction } and import { type MetaFunction } have different behaviors when build HOT 3
- Empty JS chunk created for resource route
- Error: Cannot reach Remix dev server at localhost:3001/ping HOT 5
- `npx create-remix@latest` says `Oh no! Failed to initialize git.` HOT 5
- Vite custom express migration docs don't mention 'source-map-support'
- using the default .eslintrc.js does not lint any files that exist in .server or .client folders HOT 4
- Wall of errors after upgrading to vite and navigating to index HOT 19
- Cannot import "exports": { "module": ... } without type=module configured packages, instead we could get an error: Cannot use import statement outside a module
- @remix/node should not be forced to install polyfills HOT 1
- SyntaxError: Unexpected token ',' HOT 1
- vite template doesn't start (dev server origin not set) HOT 6
- Vite thinks certain modules are CommonJS with Remix HOT 1
- TypeError: Unknown file extension ".ts". Not working dev/build with express server and import files HOT 1
- ✘ [ERROR] Could not resolve "lightningcss" ONLY when running `remix dev` HOT 1
- `No match URL` error occurs. (CloudFlare Pages) HOT 2
- docs: Invalid link for `Splat Route` at `Not found handling` HOT 1
- Vite hangs on fresh npm install when using `installGlobals` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remix.