grunt build removes d3.js and google fonts from application - d3.js

I've configured my Angular app with Yeoman, and have included many JS libraries like d3. The application works fine when I use grunt serve to see the app. But when I try to build it using grunt build, and open the generated index.html, the app breaks because it cannot find D3. If I manually include the script tag for loading D3 in final index.html, then it starts working, but that's not how it's supposed to work, right?
The grunt build also removes google Fonts which I've included in my app:
<link href='https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'>
This link tag is missing from final index.html
My bower.json looks like this:
{
"name": "myApp",
"version": "0.0.0",
"main": "index.html",
"ignore": [
"**/.*",
"node_modules",
"bower_components"
],
"dependencies": {
"jquery": "~2.2",
"lodash": "~4.9",
"bootstrap": "^3.3.6",
"angular": "~1.5",
"angular-route": "~1.5",
"angular-animate": "~1.5",
"angular-resource": "~1.5",
"angular-cookies": "^1.5.7",
"angular-mocks": "~1.5",
"angular-bootstrap": "~1.3.1",
"moment": "~2.12",
"less.js": "~2.6",
"font-awesome": "~4.5",
"d3": "^3.5.17"
}
}
I have not tested the issue with other libraries, as they might also be not working after the build. However, angular, bootstrap, font-awesome and LESS is working fine. This is driving me crazy!

I noticed that I was using dom_munger task in gruntfile. It removed all script with data-concat="false".
D3 script was being removed because it specified data-concat="false".
The problem is fixed now.

Related

Can't find RCTPushNotification.xcodeproj

I'd like to use the file RCTPushNotification.xcodeproj inside the directory node_modules/react-native/Libraries/PushNotificationIOS, to add it in my Libraries folder in order to manage iOS push notifications. I'm following this tutorial: https://www.pubnub.com/blog/react-native-push-notifications-ios-android/.
The problem is that I can't find it, even after deleting node_modules and executing npm install && react-native link.
Here is my package.json dependencies, but I don't think that a package could modify my directory:
{
"dependencies": {
"#dudigital/react-native-zoomable-view": "^1.0.14",
"firebase": "^6.5.0",
"pubnub": "^4.27.0",
"pubnub-react": "^1.3.2",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-cli": "^2.0.1",
"react-native-fast-image": "^7.0.2",
"react-native-fs": "^2.16.2",
"react-native-gesture-handler": "^1.5.0",
"react-native-image-picker": "^0.28.0",
"react-native-optimized-flatlist": "^1.0.4",
"react-native-push-notification": "^3.1.9",
"react-native-view-shot": "^3.0.2",
"react-navigation": "^3.13.0",
"react-redux": "^7.1.3",
"redux": "^4.0.4",
"rn-fetch-blob": "^0.11.2"
}
Here are the only files I can see on this directory:
NativePushNotificationManager.js
RCTPushNotificationManager.h
RCTPushNotificationManager.m
React-RCTPushNotification.podspec
Knowing that RCTPushNotificationManager.m and RCTPushNotificationManager.h should be inside my xCode project, I tried to put the entire PushNotificationIOS folder in my Libraries folder, but it doesn't seems to work because there is not the necessary Products folder inside of an xCode project.
I also tried to put each of this files in my Libraries folder, but Xcode doesn't consider them as xCode projects (not very surprising).
This issue doesn't seem to have been encountered earlier.
After just spending a lot of time and effort on push notifications, I recommend you look into OneSignal push notifications. Saved me a lot of time.
However, you should be able to find the .xcodeproj here: https://github.com/react-native-community/react-native-push-notification-ios/tree/master/ios

How to use scss file in vue js component?

I have multiple scss file those all imported in another scss file name style.scss. Now i need all the scss compile to css and use all of my components. How it is posible?
I have followed this link Followed Instruction
Can any one help me please
You can install the following dev dependencies:
"devDependencies": {
"node-sass": "^4.1.1",
"sass-loader": "^3.2.3",
"style-loader": "^0.13.1"
}
And import your scss file inside your App.vue:
<style lang="scss" scoped>#import 'style.scss'</style>

How do I enable SASS Compiling in Cookiecutter Django?

in the documentation of cookiecutter-django relating to SASS Compiling and Live Reload it's stated that I only have to enter "npm start" (after installing npm of course) in the main project folder to enable Live-Reload and SASS compiling. I was wondering how this should be possible without a package.json file but tried it nevertheless, maybe some hidden thing I did not know about. But npm init of course told me that a package.json was missing. I initialized a new project with bootstrap compilation and gulp enabled, same outcome. Still no package.json. Am I missing some key-point? Or is the documentation in this case maybe incomplete? Where do I get the required package.json from? :)
In the project generation at the beginning, you probably chose "None" on the "js_task_runner" step. If you chose "Gulp" here, it will generate gulpfile.js and package.json file, after which you'll be able to use npm install.
As mentioned in other answers, when you start your project and then choose none for task runner options, it will not work. See js_task_runner on cookiecutter-django documentation.
May I ask where you tried to run npm install? The package.json file is located in the root of your app, so you have to run commands from there.
It should be possible to add the needed files afterwards manually. Create a package.json file in the root directory of your app and add following code. Important: Change name to the name of your app.
{
"name": "CHANGE_TO_NAME_OF_YOUR_APP",
"version": "0.1.0",
"dependencies": {},
"devDependencies": {
"bootstrap": "4.1.1",
"gulp-concat": "^2.6.1",
"jquery": "3.3.1",
"popper.js": "1.14.3",
"autoprefixer": "^9.4.7",
"browser-sync": "^2.14.0",
"cssnano": "^4.1.10",
"gulp": "^4.0.0",
"gulp-imagemin": "^5.0.3",
"gulp-plumber": "^1.2.1",
"gulp-postcss": "^8.0.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^4.0.2",
"gulp-uglify-es": "^1.0.4",
"pixrem": "^5.0.0"
},
"engines": {
"node": ">=8"
},
"browserslist": [
"last 2 versions"
],
"scripts": {
"dev": "gulp"
}
}
Since this project uses gulp.js as task runner you need additionally to the package.json also a gulpfile.js file. Code from this example should work. Check also if you have a scss file in name_of_your_app/static/sass/project.scss.
Now you should be able to run npm install in a first step and compile scss with npm run dev in a second step (see documentation).

How do I get Aurelia to process scss

I have created a new Aurelia using the cli and setting scss for the CSS Processor and webpack for the bundler. My problem is the scss seems to be ignored and I cant work out why.
I have a file in project /src/styles/styles.scss
Inside the aurelia.json file (I have added the source property)
...
"cssProcessor": {
"id": "sass",
"displayName": "Sass",
"fileExtension": ".scss",
"source": "src/**/*.scss"
},
...
Have you imported your scss-file in any components? I think you can make it work by adding this line to your app.ts file (or whatever startup component you are using)
import 'app.scss';
Requiring it in the template should also work, a discussion of both methods is available here: https://github.com/aurelia/webpack-plugin/issues/14

Nativescript: TypeError: Invalid Version: 1.?2.0

I'm getting the error while installing the plugin.
TypeError: Invalid Version: 1.?2.0
I've created the plugin for NativeScript.
Here is how my package.json looks like.
{
"name": "nativescript-toaster",
"version": "1.0.1",
"main": "index.js",
"nativescript": {
"platforms": {
"android": "1.​2.0"
}
}
}
As described in some forums I've tried to remove the android entries from package.json of NS projects, and clean cache npm cache clean. But as I add android platform tns platform add android it comes again.
Please share if you've any idea about this.
Thanks Guys
I was getting the same error. In my case, I was trying to include iOS and Android native code; I tried changing it like this: "1.3.0" , and the error disappeared.

Resources