i have bought a template, that used F7 v5.1.0 , it has the following folders: [css, fonts, img, js, pages, index.html]
Started a fresh project to understand a little bit more how things work. For the first project i didn’t use webpack, and by simply adding files to the www, worked like a charm.
Now, i can’t find any option to build for production. It seems i need to use webpack
Made a new project this time using webpack, this time i added the folders to src/
When i try: npm run dev , it loads the app.js file, and index.html file only. No CSS, no routes working, no links working , nothing works besides showing index.html text content Not good
I understand that creating a project and then importing files not related is not the best of the ideas, but its all i’ve got.
Should i edit the webpack.config.js? This seems to be a problem with unreachable files.
no need to modofy webpack. split your plain html+css project in components. declare the routes for each page etc. you have refactor your template to use webpack. thats the celanest way in my opinion. also you can just put all the folders like fonts css img in the static folder. then import them.
Nothing is loaded , for example, i get Failed to load resource: the server responded with a status of 404 (Not Found) for every file referenced from index.html, but funny enough, it loads the ./src/index.html and ./src/js/app.js CORRECLY!
EDIT:
Ok, got it solved, had to remove “static” from:
new CopyWebpackPlugin({
patterns: [
{
noErrorOnMissing: true,
from: resolvePath('src/static/'),
to: resolvePath('www/static/'),
},
],
}),