Ember - Minify CSS File in public Folder - ember.js

When I build my super-rentals Ember app with command ember build -prod all css files in app\styles folder are minified but css files in public\assets\css folder are not minified. So how I could minify all css file in public\assets\css folder.

Related

Publish html/js project to github page

I have a simple javascript projet created using npm. The source code is in a public github repository.
Here is the content of the repository
my-project
src
index.html
app.js
package.json
README.md
In my local environment I run it using lite-server by executing npm run dev.
I create gh-pages branch from my main branch, my code was automatically deployed after but when I visit the page it show the content of the README.md file.
How can I point to my index.html page instead so that my simple website is rendered ?
Do I have to absolutely move my index.html to the root directory ? Or is there other way without changing my project folder structre ?
=============== MY SOLUTION ===============
I just had to copy index.html and app.js at the root of the branch gh-pages.
You can only choose the root folder or /docs from repo settings.
https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site

Publish SCSS file into NPM package Vue-cli 3

I am authoring a Vue.js lib on NPM and one of my users is asking me to add my scss file into the build so they can modify it.
How can users modify that scss file and compile it back to my lib?
Would that be a hack like modifying a lib's source code or is that common practice?
If I externalize that scss into a static file (I suspect in public/ folder), how do I include it from my component?
Is there a documentation about it, I looked into Vue-cli, Webpack, and Google and didn't find a guide.
Currently I only export a minified css file into the build and my scss resides in my index.vue of my component.
My project architecture is:
| public/
| src/
| assets/
| components/
|- my-lib/ // Only this folder gets bundled into dist/
|- index.vue
|- app.vue // My app documentation.
In the dist/ folder I get:
mylib.css
mylib.umd.js
mylib.umd.min.js
mylib.common.js
mylib.umd.min.js
demo.html
I bundle my lib (with vue-cli 3) with:
vue-cli-service build --target lib --name mylib ./src/components/mylib/index.vue --dest ./dist

Why doesn't my React-Django app detect static files?

I have created a working React + Django REST project and it works fine on my development machine. I have used the following method to make it work on my CentOS 7 server.
I created the build directory using npm run build and copied that to the Django project root folder.
I added the build directory on TEMPLATES list in Django settings to identify the index.html file.
I added build/static folder in STATICFILES_DIRS.
I added url(r'^.*', TemplateView.as_view(template_name='index.html')), line to the root URLS file to capture all url patterns and load the index file in build folder that contains the React app.
I run manage.py collectstatic to create a staticfiles folder with all static files.
I added the staticfiles folder to the Nginx conf file like following:
location /static/ {
root /home/michel/project/staticfiles;
}
I have restarted the nginx server.
I am using the Django server to load the index.html file and I expect that the staticfiles folder will contain necessary static files to load my React app.
However, when I visit www.mydomain.com it loads the index.html file, but does NOT load the React app on <div id='root'></div>. I know this because the footer of the index is shown, but the css for styling that footer is also not working.
I am guessing that I have a problem of making the static files being detected. Any solution?
EDIT
Here is the code that links my React app to the index.html file.
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
P.S. It is automatically generated by the create-react-app command.
Its probably because you don't understand the Nginx root directive.
This:
location /static/ {
root /home/michel/project/staticfiles;
}
Means if I request www.yourwebsite.com/static/style.css then Nginx is going to expect that file location to be
/home/michel/project/staticfiles/static/style.css
not
/home/michel/project/staticfiles/style.css

Angular 5 build and Zone.js

Have the picture error after build my angular 5 app, i serve my app with a django view.
I added the zone.js dependencie in my angular package.json file but i get the same error.
this is my Github gists view and template, the view load all files in the static path. this works fine.
Regards
Solve, the error it's the order of the scripts load by my django view, the view load the scripts in the folders order, but most be the next:
inline
polyfills
scripts
main

Serving webpack built assets from a subdirectory

In all the examples I've seen, the entrypoint html file (e.g. index.html) lives alongside all the built assets emitted by webpack.
build/
index.html
bundle.js
1.bundle.js
2.bundle.js
etc
I'd like to have my entrypoint html separate from the built assets:
index.html
build/
bundle.js
1.bundle.js
2.bundle.js
etc
Is this possible with webpack?
Aha, figured it out. In the webpack.config, you have to set output.publicPath. That path is used to prefix all relative URLs in CSS.
In my case, I used:
output: {
path: path.resolve('./build'),
publicPath: './build/',
filename: '[name].bundle.js'
},
http://webpack.github.io/docs/configuration.html#output-publicpath