Comments (10)
@Atinux I propose considering making ./src the default folder, to bring it to parity with how vue-cli generates projects - makes for a more consistent experience imo. just a thought!
from nuxt.
I'm working on it to merge it pretty soon :)
from nuxt.
@danieloprado once the pull request is excepted you'll be able to do that. #44
from nuxt.
Ok, so looking through the code there is a rootDIr
option. After setting that to ./src
, I get the following error:
○ nuxt
nuxt:build App root: src +0ms
nuxt:build Generating .nuxt/ files... +2ms
nuxt:build Generating routes... +6ms
nuxt:build Generating files... +7ms
nuxt:build Adding webpack middlewares... +13ms
Ready on http://localhost:3000
webpack built 6040be73cf7bdbc8b0ad in 123ms
Hash: 6040be73cf7bdbc8b0ad
Version: webpack 2.1.0-beta.27
Time: 123ms
Asset Size Chunks Chunk Names
nuxt.bundle.js 399 bytes 0 app
vendor.bundle.js 30.7 kB 1 vendor
nuxt.bundle.js.map 91 bytes 0 app
vendor.bundle.js.map 32.2 kB 1 vendor
ERROR in multi vendor
Module not found: Error: Can't resolve 'vue' in '/Users/cj/Sync/apps/acd/nuxt'
@ multi vendor
ERROR in multi vendor
Module not found: Error: Can't resolve 'vue-router' in '/Users/cj/Sync/apps/acd/nuxt'
@ multi vendor
ERROR in multi vendor
Module not found: Error: Can't resolve 'vue-meta' in '/Users/cj/Sync/apps/acd/nuxt'
@ multi vendor
ERROR in multi vendor
Module not found: Error: Can't resolve 'es6-promise' in '/Users/cj/Sync/apps/acd/nuxt'
@ multi vendor
ERROR in multi vendor
Module not found: Error: Can't resolve 'es6-object-assign' in '/Users/cj/Sync/apps/acd/nuxt'
@ multi vendor
ERROR in multi app
Module not found: Error: Can't resolve 'babel-loader' in '/Users/cj/Sync/apps/acd/nuxt'
@ multi app
ERROR in multi app
Module not found: Error: Can't resolve 'webpack-hot-middleware/client?reload=true' in '/Users/cj/Sync/apps/acd/nuxt'
@ multi app
Entry module not found: Error: Can't resolve 'babel-loader' in '/Users/cj/Sync/apps/acd/nuxt'
resolve 'babel-loader' in '/Users/cj/Sync/apps/acd/nuxt'
Parsed request is a module
using description file: /Users/cj/Sync/apps/acd/nuxt/package.json (relative path: .)
after using description file: /Users/cj/Sync/apps/acd/nuxt/package.json (relative path: .)
resolve as module
/Users/cj/Sync/apps/acd/nuxt/src/node_modules doesn't exist or is not a directory
/Users/cj/Sync/apps/src/node_modules doesn't exist or is not a directory
/Users/cj/Sync/apps/acd/src/node_modules doesn't exist or is not a directory
/Users/cj/Sync/src/node_modules doesn't exist or is not a directory
/Users/cj/src/node_modules doesn't exist or is not a directory
/Users/src/node_modules doesn't exist or is not a directory
/src/node_modules doesn't exist or is not a directory
looking for modules in /Users/cj/Sync/apps/acd/nuxt/node_modules/nuxt/node_modules
using description file: /Users/cj/Sync/apps/acd/nuxt/node_modules/nuxt/package.json (relative path: ./node_modules)
after using description file: /Users/cj/Sync/apps/acd/nuxt/node_modules/nuxt/package.json (relative path: ./node_modules)
using description file: /Users/cj/Sync/apps/acd/nuxt/node_modules/nuxt/package.json (relative path: ./node_modules/babel-loader)
as directory
/Users/cj/Sync/apps/acd/nuxt/node_modules/nuxt/node_modules/babel-loader doesn't exist
no extension
/Users/cj/Sync/apps/acd/nuxt/node_modules/nuxt/node_modules/babel-loader doesn't exist
.js
/Users/cj/Sync/apps/acd/nuxt/node_modules/nuxt/node_modules/babel-loader.js doesn't exist
.json
/Users/cj/Sync/apps/acd/nuxt/node_modules/nuxt/node_modules/babel-loader.json doesn't exist
/Users/cj/Sync/apps/acd/nuxt/node_modules/memory-fs/lib/MemoryFileSystem.js:114
throw new MemoryFileSystemError(errors.code.ENOENT, _path);
^
Error: no such file or directory
at MemoryFileSystem.readFileSync (/Users/cj/Sync/apps/acd/nuxt/node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
at Watching.webpackServerWatcher.serverCompiler.watch [as handler] (/Users/cj/Sync/apps/acd/nuxt/node_modules/nuxt/lib/build/index.js:268:35)
at Watching._done (/Users/cj/Sync/apps/acd/nuxt/node_modules/webpack/lib/Compiler.js:96:7)
at /Users/cj/Sync/apps/acd/nuxt/node_modules/webpack/lib/Compiler.js:76:18
at Compiler.emitRecords (/Users/cj/Sync/apps/acd/nuxt/node_modules/webpack/lib/Compiler.js:350:37)
at /Users/cj/Sync/apps/acd/nuxt/node_modules/webpack/lib/Compiler.js:59:19
at /Users/cj/Sync/apps/acd/nuxt/node_modules/webpack/lib/Compiler.js:343:11
at Compiler.applyPluginsAsyncSeries (/Users/cj/Sync/apps/acd/nuxt/node_modules/tapable/lib/Tapable.js:95:46)
at Compiler.afterEmit (/Users/cj/Sync/apps/acd/nuxt/node_modules/webpack/lib/Compiler.js:340:8)
at Compiler.<anonymous> (/Users/cj/Sync/apps/acd/nuxt/node_modules/webpack/lib/Compiler.js:335:14)
from nuxt.
I'm trying to end up with this structure:
from nuxt.
looks like there needs to be a srcDir
option. going to fork and add one.
from nuxt.
Hi @cj, why do you want to have this structure?
You need to have the node_modules/ and the nuxt.config.js in the src/ folder to make it work.
from nuxt.
I´m looking for same option, I would like to move all file to a app folder to separate my server/api files, a rootDir option would be great!
app
|--components
|--pages
|--static
server
|--main.js
|--etc..
from nuxt.
You can now use the v0.8.4 🎊
from nuxt.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from nuxt.
Related Issues (20)
- [nuxt] A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function. This is probably not a Nuxt bug. Find out more at `https://nuxt.com/docs/guide/concepts/auto-imports#vue-and-nuxt-composables`. HOT 6
- Problems building Nuxt 3 on electron startup
- useHead doubling the baseURL only when served from that domain HOT 2
- Dynamic Menu Generation Based on Directory or Route Configuration in Nuxt 3 SSR HOT 1
- [useFetch] Component is already mounted, please use $fetch instead. See https://nuxt.com/docs/getting-started/data-fetching HOT 12
- Problem with route rules in nuxt.config HOT 3
- How to copy file to folder .output after build(2) HOT 2
- Decode function for useCookie called for every cookie present
- Docs: Cannot get API Docs for nuxt.config.ts HOT 2
- Wrong status codes in server plugins HOT 3
- autoImport for utils directory doesn't work correctly. HOT 6
- Reactive object does not trigger asyncData HOT 1
- <script setup> does not run on Pages which where navigated to by <NuxtLink> HOT 2
- Compressing response breaking error page HOT 1
- Cannot set properties of null (setting '__vrv_devtools') HOT 5
- [Performance] Using this.$route inside a computed triggers reactivity while we are changing pages HOT 5
- PublicRuntimeConfig type not being recognized by eslint, only happens after nuxt 3.11.2 HOT 1
- 在文件内容没有变化的情况下,每次打包出来的构建产物javascript文件的hash值都不一致 HOT 4
- PostCSS breaking on adding tailwind plugin for nuxt-tour specifically, unable to start nuxt dev server HOT 2
- _How to run "useLazyAsyncData" on client-side only?_ Use the "clientSide" option. For example: Nuxt.useLazyAsyncData(objects, { clientSide: true }); HOT 2
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 nuxt.