If I type the grunt the following error is displaying:
Fatal error: Different sources attempting to write to the same destination:
{
"dest": "dist\\scripts\\dynamic-form\\dynamic-form.min.js",
"src": [
"app\\scripts\\dynamic-form\\dynamic-form.min.js"
]
}
{
"files": []
}
Ensure that styles/vendor.css, as required by login.pt and index.pt have
the same resources.
i just configure in my grunt file.js as shown below
{
"dist\\scripts\\dynamic-form\\dynamic-form.min.js": [
"app\\scripts\\dynamic-form\\dynamic-form.min.js"]
}
Related
Spinning up the sanity studio gets me this error. The page spins up just fine in local host. Any help fixing this would be greatly appreciated
here is the error in full:
[plugin:vite:css] [postcss] Cannot read properties of undefined (reading 'config')
at getTailwindConfig (/Users/adamsmith/Desktop/codingprojects/portfolio/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:84:63)
at /Users/adamsmith/Desktop/codingprojects/portfolio/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:96:92
at /Users/adamsmith/Desktop/codingprojects/portfolio/node_modules/tailwindcss/lib/processTailwindFeatures.js:46:11
at plugins (/Users/adamsmith/Desktop/codingprojects/portfolio/node_modules/tailwindcss/lib/index.js:38:63)
at LazyResult.runOnRoot (/Users/adamsmith/Desktop/codingprojects/portfolio/portfolio-build/node_modules/postcss/lib/lazy-result.js:339:16)
at LazyResult.runAsync (/Users/adamsmith/Desktop/codingprojects/portfolio/portfolio-build/node_modules/postcss/lib/lazy-result.js:393:26)
at LazyResult.async (/Users/adamsmith/Desktop/codingprojects/portfolio/portfolio-build/node_modules/postcss/lib/lazy-result.js:221:30)
at LazyResult.then (/Users/adamsmith/Desktop/codingprojects/portfolio/portfolio-build/node_modules/postcss/lib/lazy-result.js:206:17)
at processTicksAndRejections (node:internal/process/task_queues:96:5
This is the contents of my tailwind.config.js file
#type {import('tailwindcss').Config}
module.exports = {
content: [
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [
require('tailwind-scrollbar')
],
}
I ended up creating a tailwind.config.js file in the sanity folder with the following information. It fixed it.
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
'./app/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
plugins: [],
}
When you create the tailwindcss, Ensure that the content array is not empty, do add the following:
/** #type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
'./app/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
plugins: [],
}
In my case create tailwind.config.js file in the sanity folder and add the code below in that created file
/** #type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
'./app/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
plugins: [],
}
I had the same error, changing tailwind.config.js file location to under the "sanity-backend" folder, fixed an error for me.
After moving the tailwind.config.js file into the Sanity folder, Sanity worked, but the front end caused the error.
To make it work have two copies of the tailwind CSS file one for the root directory and one inside the Sanity folder.
Hello I am having great difficulty building my angular application for production.
I am running the 'ng build --prod' command however when i open the 'dist' folder i don't see all my components there. Is there something else i have to change or configure? When opening the 'dist' folder i see some components.
angular.json
{
"$schema":"./node_modules/#angular/cli/lib/config/schema.json",
"version":1,
"newProjectRoot":"projects",
"projects":{
"app":{
"projectType":"application",
"schematics":{
"#schematics/angular:component":{
"style":"scss"
}
},
"root":"",
"sourceRoot":"src",
"prefix":"app",
"architect":{
"build":{
"builder":"#angular-devkit/build-angular:browser",
"options":{
"outputPath":"dist/app",
"index":"src/index.html",
"main":"src/main.ts",
"polyfills":"src/polyfills.ts",
"tsConfig":"tsconfig.app.json",
"aot":false,
"assets":[
"src/favicon.ico",
"src/assets",
"src/images"
],
"styles":[
"src/styles.scss"
],
"scripts":[
]
},
"configurations":{
"production":{
"fileReplacements":[
{
"replace":"src/environments/environment.ts",
"with":"src/environments/environment.prod.ts"
}
],
"optimization":true,
"outputHashing":"all",
"sourceMap":false,
"extractCss":true,
"namedChunks":false,
"aot":true,
"extractLicenses":true,
"vendorChunk":false,
"buildOptimizer":true,
"budgets":[
{
"type":"initial",
"maximumWarning":"2mb",
"maximumError":"5mb"
},
{
"type":"anyComponentStyle",
"maximumWarning":"6kb",
"maximumError":"10kb"
}
]
}
}
},
"serve":{
"builder":"#angular-devkit/build-angular:dev-server",
"options":{
"browserTarget":"app:build"
},
"configurations":{
"production":{
"browserTarget":"app:build:production"
}
}
},
"extract-i18n":{
"builder":"#angular-devkit/build-angular:extract-i18n",
"options":{
"browserTarget":"app:build"
}
},
"test":{
"builder":"#angular-devkit/build-angular:karma",
"options":{
"main":"src/test.ts",
"polyfills":"src/polyfills.ts",
"tsConfig":"tsconfig.spec.json",
"karmaConfig":"karma.conf.js",
"assets":[
"src/favicon.ico",
"src/assets"
],
"styles":[
"src/styles.scss"
],
"scripts":[
]
}
},
"lint":{
"builder":"#angular-devkit/build-angular:tslint",
"options":{
"tsConfig":[
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude":[
"**/node_modules/**"
]
}
},
"e2e":{
"builder":"#angular-devkit/build-angular:protractor",
"options":{
"protractorConfig":"e2e/protractor.conf.js",
"devServerTarget":"app:serve"
},
"configurations":{
"production":{
"devServerTarget":"app:serve:production"
}
}
}
}
}
},
"defaultProject":"app"
}
ts.config.json
{
"compileOnSave":false,
"compilerOptions":{
"baseUrl":"./",
"outDir":"./dist/out-tsc",
"sourceMap":true,
"declaration":false,
"downlevelIteration":true,
"experimentalDecorators":true,
"module":"esnext",
"moduleResolution":"node",
"importHelpers":true,
"target":"es2015",
"typeRoots":[
"node_modules/#types"
],
"lib":[
"es2018",
"dom"
]
},
"angularCompilerOptions":{
"fullTemplateTypeCheck":true,
"strictInjectionParameters":true
}
}
Output when running a new build:
I now get this error when run in the console locally:
Failed to load resource: net::ERR_FILE_NOT_FOUND
index.html:1 Access to script at 'file:///C:/polyfills-es2015.0fe6949bc5ff4b784062.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
Yes this is how it should look, you have the index.html, the favicon.ico, a css file and a bunch of .js file. Their names are weird because Angular "compile" them this way. If you visit your website it'll be working
When you run ng build --prod, then Angular will do some actions (rough description):
Run module bundler(e.g. WebPack).
WebPack will see should all modules and will create a dependency tree. Then WebPack based on dependency tree will inlcude only used components in final file(bundle). It is called tree shaking.
Then uglify happens. Uglify means all unnecessary whitespaces will be deleted, variable names will be shortened
So this is a reason why you don't see any components and why you cannot debug bundled files.
I'm using Jsdoc 3.6.2. I have this source configuration in conf.json:
"source": {
"exclude":["MyProj/excludeFolder"],
"includePattern": ".+\\.js(doc|x|xinc)?$",
"excludePattern": "(^|\\/|\\\\)_"
}
When I execute jsdoc -r -c pathToMy/conf.json on MyProj directory , Jsdoc is not excluding 'excludeFolder' folder. I know that it is using the correct config.json file because it's including all .jsxinc files. How can I fix that?
EDIT:
I'm working on Windows 10 and vscode. Jsdoc is installed globally on C:/Users/myUser/appData/Roaming/npm. I've created a toy project on C:/Users/myUser/myProject with the following structure:
myProject/
|-out/
|-conf.json
|-src/
|-includeFile.jsxinc
|-excludeFolder/
|-exludeFile.jsxinc
This is the full conf.json:
{
"tags": {
"allowUnknownTags": true
},
"source": {
"exclude":["myProject/src/excludeFolder"],
"includePattern": ".+\\.js(doc|x|xinc)?$",
"excludePattern": "(^|\\/|\\\\)_"
},
"plugins": [],
"templates": {
"cleverLinks": false,
"monospaceLinks": false,
"default": {
"outputSourceFiles": true
}
}
}
This is the code in 'excludeFile.jsxinc':
/**
* #class
*/
function excludeClass(){}
And this is the code in 'includeFile.jsxinc':
/**
* #class
*/
function includeClass(){}
When I run the following comand on power shell at C:/Users/myUser/myProject: jsdoc -c C:/Users/myUser/myProject/out/conf.json -r., documentation is generated for both classes: includeClass and excludeClass. In the real project, the exclude folder contains third party libraries that use jsdoc.
I was facing same issue and I resolved with this:
"excludePattern": "myProject/src/excludeFolder"
and delete "exclude" attribute.
I'm trying to make this compressor to output tgz files using this configuration. This works perfectly fine with ".zip" instead of ".tar.gz" as the file extension and with "zip" as mode. Howevever I can't make it work with the tar/tgz format.
module.exports = function (paramsConfig) {
'use strict';
return {
'main': {
'options': {
'archive': 'filePath/fileName.tar.gz',
'mode': 'tar',
'level': 9
},
'files': [
{
'cwd': 'distributionDir/../',
'expand': true,
'src': ['**/*']
}
]
}
};
};
Whenever I try to run the compressor with the tar configuration, this is the error printed:
Fatal error: The "string" argument must be of type string. Received type number
This is strange because it does compress all the files albeit ending with that error.
New to grunt I have successfully used it to run purifycss. Now I want to run purifycss twice with different arguments, and ideally concat the two resulting files afterwards.
What I have so far is this Gruntfile:
module.exports = function(grunt) {
grunt.initConfig({
purifycss: {
bootstrap: {
options: {},
target: {
src: [ 'live/*.twig' ],
css: ['live/css/bootstrap*.css'],
dest: 'purified_bootstrap.css'
}
},
mycss: {
options: {},
target: {
src: [ 'live/*.twig' ],
css: ['live/css/mycss.css'],
dest: 'purified_mycss.css'
}
}
}
});
grunt.loadNpmTasks('grunt-purifycss');
grunt.registerTask('purify', ['purifycss:bootstrap', 'purifycss:mycss']);
};
The output I get when running grunt purify from terminal:
> grunt purify
Running "purifycss:bootstrap" (purifycss) task
Warning: Cannot call method 'forEach' of undefined Use --force to continue.
Aborted due to warnings.
Any help on what's going wrong here appreciated!