Comments (8)
Agree on this one. I always add a media
folder within src
where I put all the non static assets like images and videos served as test content. This folder also contains .json
and .html
files used for async fetching of data. A watch task is added to make sure files are copied to the dist
folder.
from frontend-boilerplate.
I would say that images, video's and json files belong in the /static
folder. According to your comment I think we should add json
and video
tot src/static
and implement the corresponding gulp tasks. I think the json task should only run in dev mode and the video task should run in both dev and dist.
from frontend-boilerplate.
All files used for mocking or content purpose should not be included within the /src/static
folder. There is no need for them to be in a production environment. Adding a folder directly within /src
would be a better place for these files. The name for this folder can be something like 'mock' or 'media'.
from frontend-boilerplate.
Great idea! 👍
Why not place your json mock files inside the components
folder, together with the html, css and js? Since the front-end bootstrap is not an actual application itself, a json file isn't any different from a html file for example. All the HTML code we produce is implemented in a server-side application, not used by itself.
The front-end bootstrap environment is basically a static site generator. Sometimes the results are uploaded to a static site host, so a user would expect all the json mock files to be available, otherwise a demo would not function, thereby not having any value as a demo.
I always try to make my json test data component-specific. An example component folder could then be like:
src/
components/
nav/
nav.html
nav.css
nav.js
nav.json
If you don't want those json files to be automatically released to production, you should do just that: make the build (or backend developer) not simply copy/move those files into production when they shouldn't.
PS: As a side note, I disagree with the term 'media', which is defined as images/videos/etc, certainly not raw json data.
from frontend-boilerplate.
Sounds good to put the json files within the components folders but sometimes json are used on a higher scope.
It also leaves us with the problem of where to put the videos and images, etc.
from frontend-boilerplate.
This issue seems really about json mock data. For images we already have a folder, and videos are an exception I think.
from frontend-boilerplate.
Maybe we could rename media to assets to allow it to contain a broader range of contenttypes?
from frontend-boilerplate.
Closing, dupe of #9
from frontend-boilerplate.
Related Issues (20)
- Refactor githook prepare-commit-msg
- Build process shows errors HOT 3
- Add engines config to package.json HOT 5
- Babel error when installing fresh repository with yarn HOT 3
- Webpack / Rollup Version HOT 2
- Activate template repository setting HOT 1
- Data structured markup HOT 6
- Gulp task sassdoc HOT 7
- Refactor githooks tasks
- Using ES2015 code within the vendor directory breaks the Uglify task HOT 2
- Remove Sassdoc from project
- Update mustard cut HOT 1
- Improved structure of folders in template list
- Static files only work in a website's root folder HOT 2
- yml RangeError: Maximum call stack size exceeded HOT 1
- nav.html:11 Uncaught ReferenceError: hljs is not defined
- Code changes trigger browserifies watchify multiple times HOT 1
- Fatal error: "JavaScript heap out of memory" on css-lint task HOT 1
- NJK crashes if component name is the same as the template name 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 frontend-boilerplate.