-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(common): resolve source instead of bundle on development #264
Changes from 2 commits
535335c
674a866
72c0ea3
f624026
7632dab
30661d2
f7726dc
42bc1f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { defineConfig } from 'vite' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I said in the description of this PR, we're having this separate vite config files here, but they're actually extending the real configs, adding only this alias. |
||
import base from '../templates/js/vite.config' | ||
import path from 'path' | ||
|
||
export default defineConfig({ | ||
...base, | ||
resolve: { | ||
alias: [ | ||
{ | ||
find: /^@storyblok\/field-plugin$/, | ||
replacement: path.resolve(__dirname, '../../field-plugin/src/index.ts'), | ||
}, | ||
], | ||
}, | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { defineConfig } from 'vite' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I welcome any suggestion on this folder or filenames. |
||
import base from '../templates/react/vite.config' | ||
import path from 'path' | ||
|
||
export default defineConfig({ | ||
...base, | ||
resolve: { | ||
alias: [ | ||
{ | ||
find: /^@storyblok\/field-plugin$/, | ||
replacement: path.resolve(__dirname, '../../field-plugin/src/index.ts'), | ||
}, | ||
], | ||
}, | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { defineConfig } from 'vite' | ||
import base from '../templates/vue2/vite.config' | ||
import path from 'path' | ||
|
||
export default defineConfig({ | ||
...base, | ||
resolve: { | ||
alias: [ | ||
{ | ||
find: /^@storyblok\/field-plugin$/, | ||
replacement: path.resolve(__dirname, '../../field-plugin/src/index.ts'), | ||
}, | ||
], | ||
}, | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { defineConfig } from 'vite' | ||
import base from '../templates/vue3/vite.config' | ||
import path from 'path' | ||
|
||
export default defineConfig({ | ||
...base, | ||
resolve: { | ||
alias: [ | ||
{ | ||
find: /^@storyblok\/field-plugin$/, | ||
replacement: path.resolve(__dirname, '../../field-plugin/src/index.ts'), | ||
}, | ||
], | ||
}, | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { PluginOption, defineConfig } from 'vite' | ||
import { defineConfig, PluginOption } from 'vite' | ||
import dts from 'vite-plugin-dts' | ||
import { resolve } from 'path' | ||
|
||
|
@@ -17,4 +17,15 @@ export default defineConfig({ | |
external: ['querystring'], | ||
}, | ||
}, | ||
resolve: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eunjae-lee, I may be not seeing something here, but does it make sense to have this alias also for the I mean, it seems that the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, nice catch! Thanks |
||
alias: | ||
process.env.node_env === 'production' | ||
? [] | ||
: [ | ||
{ | ||
find: /^@storyblok\/field-plugin$/, | ||
replacement: resolve(__dirname, '../field-plugin/src/index.ts'), | ||
}, | ||
], | ||
}, | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,15 @@ export default defineConfig({ | |
}, | ||
}, | ||
}, | ||
resolve: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is totally fine for now, but the helpers will also need some kind of automated mechanism in the future, so that the developer does not need to take care of it. |
||
alias: | ||
process.env.node_env === 'production' | ||
? [] | ||
: [ | ||
{ | ||
find: /^@storyblok\/field-plugin$/, | ||
replacement: resolve(__dirname, '../field-plugin/src/index.ts'), | ||
}, | ||
], | ||
}, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this yarn workspace command is run,
process.cwd()
will bepackages/cli/templates/react
, not the root directory. So, the config path looks like that.