In asp.net core application I have bundleconfig.json file like below
[
{
"outputFileName": "wwwroot/css/site.min.css",
"inputFiles": [
"wwwroot/css/site.css"
]
},
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"wwwroot/js/site.js"
],
"minify": {
"enabled": true,
"renameLocals": true
}
},
{
"outputFileName": "wwwroot/js/home.min.js",
"inputFiles": [
"wwwroot/js/home.js"
],
"minify": {
"enabled": true,
"renameLocals": true
}
},
{
"outputFileName": "wwwroot/js/util.min.js",
"inputFiles": [
"wwwroot/js/util.js"
],
"minify": {
"enabled": true,
"renameLocals": true
}
},
{
"outputFileName": "wwwroot/js/profile.min.js",
"inputFiles": [
"wwwroot/js/profile.js"
],
"minify": {
"enabled": true,
"renameLocals": true
}
},
{
"outputFileName": "wwwroot/js/documentdetailmodule.min.js",
"inputFiles": [
"wwwroot/js/documentdetailmodule.js"
],
"minify": {
"enabled": true,
"renameLocals": true
}
},
{
"outputFileName": "wwwroot/css/navbar.min.css",
"inputFiles": [
"wwwroot/css/navbar.css"
]
}
]
when I publish the application all the files get minified except documentdetailmodule.js. The path and name are correct. After publishing i checked ...\Release\PublishOutput\wwwroot\js folder and i noticed documentdetailmodule.js file is there however documentdetailmodule.min.js is not there.
How do check if there are any errors during minification ( i don't see it in output window)
I am using VS 2017
Update 1
Note that documentdetailmodule.js file is newly added to the solution. and then updated bundleconfig.js accordingly
Update 2
So after further review, it turned out visual studio actually not minifying any file ( .js or .css). The reason I see a minified version of other files because those files already have their minified version under wwwroot/js folder and publishing action just copies those files.
Typically VS 2017 creates a minified version as soon as you save the file. I am not sure what has changed in Visual Studio that causing not to minify file.
Related
I am new to monorepo.
The thing is they want me to upload a sourcemap to the rollbar.
But I don't know how to generate one.
When I ask for help they told me to read documents. I read the documents / watch Youtube videos for long time but i am still not clear about generating the source map.
In our monorepo we got lots of project
apps
- ProjectA
- ProjectB
- ProjectC
- ProjectD
The thing is i want to generate source map for the ProjectC.
To generate the source map I think i need to build the project ( tell me if i am wrong )
so I look into the project.json. But I don't see the build command.
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/ProjectC",
"projectType": "application",
"targets": {
"lint": {
"executor": "#nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/ProjectC/src/**/*.ts"]
}
},
"test": {
"executor": "#nrwl/jest:jest",
"outputs": ["coverage/apps/ProjectC"],
"options": {
"jestConfig": "apps/ProjectC/jest.config.ts",
"passWithNoTests": true
}
}
},
"tags": []
}
How can i configure so that it will produce a sourcemap file? ProjectC is a vue app.
The thing is in the tsconfig.app.json. I see the configuration like this. But I don't find the source map. Is this file related to generating source map?
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"types": ["webpack-env", "jest"],
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
},
"include": ["src/**/*.ts", "src/**/*.vue", "tests/**/*.ts"],
"exclude": ["node_modules"]
}
My React Native project already has alias of some folder. They are put in babel.config.js file:
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
'plugins': [
[
'module-resolver',
{
'root': [
'.',
],
'alias': {
'assets/*': './src/assets/*',
'images': './src/assets/images',
'navigation': './src/navigation',
'navigation/*': './src/navigation/*',
'screens': './src/screens',
'screens/*': './src/screens/*',
'splash': './src/modules/splash',
'utils': './src/utils',
'utils/*': './src/utils/*',
'translations': './src/utils/translations',
'translations/*': './src/utils/translations/*',
'msg': './src/utils/translations/msg',
'languages': './languages',
'styles': './src/styles',
'styles/*': './src/styles/*',
'components': './src/components',
'constant': './src/constant',
'context': './src/context',
'api': './src/API',
'store': './src/store',
'store/*': './src/store/*',
},
},
],
'react-native-reanimated/plugin',
],
'env': {
'production': {
'plugins': [
'transform-remove-console',
],
},
},
};
But when I import a function using these alias, the intellisense does not work. I also try to create jsonconfig.json follow this document (https://code.visualstudio.com/docs/languages/jsconfig)
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"app/*": ["src/app/*"],
"assets/*": ["src/assets/*"],
"images": ["/src/assets/images"],
"navigation": ["/src/navigation"],
"navigation/*": ["/src/navigation/*"],
"screens": ["/src/screens"],
"screens/*": ["/src/screens/*"],
"splash": ["/src/modules/splash"],
"utils": ["/src/utils"],
"utils/*": ["/src/utils/*"],
"translations": ["/src/utils/translations"],
"translations/*": ["/src/utils/translations/*"],
"msg": ["/src/utils/translations/msg"],
"languages": ["/languages"],
"styles": ["/src/styles"],
"styles/*": ["/src/styles/*"],
"components": ["/src/components"],
"constant": ["/src/constant"],
"context": ["/src/context"],
"api": ["/src/API"],
"store": ["/src/store"],
"store/*": ["/src/store/*"],
}
}
}
but still not working. Anyone can help me to fix the intellisense in VS Code?
I am trying to find the equivalent config.json file entry in krakenjs for the below code.
app.use("/app/static", express.static(path.join(__dirname, 'public'), {maxage: '2h'}));
I tried something like the below. But, it didn't pick the mounted path
"static": {
"enabled": true,
"priority": 40,
"name": "server-static",
"module": {
"arguments": [
"path:./public",
{"maxAge" : "3h"},
"mountpath:/app/static"
]
}
}
I am unable to access it with the following URL : https://app.com/app/static/style.css. But, it is accessible via https://app.com/app/style.css
Note: /app is my requestURI.
I figured out. Here is how it is configured.
"static": {
"enabled": true,
"priority": 40,
"name": "server-static",
"module": {
"arguments": [
"path:./public",
{"maxAge" : "3h"}
]
},
"route": "/static"
},
I'd like to prevent src/config.js to be bundled in scripts/app-bundle.js
I saw that previously the syntax was:
"bundles": {
"dist/app-build": {
"includes": [
"[**/*.js]",
"**/*.html!text",
"**/*.css!text",
"cloneya",
"dexie",
"jquery",
"jquery-ui",
"medium-editor-webpack",
"moment",
"polymer/mutationobservers",
"safe-json-stringify"
],
excludes: [
"config.js" // So our wildcard globbing doesn't include this config file
],
...
However the new syntax is different: aurelia.json:
"bundles": [
{
"name": "app-bundle.js",
"source": [
"[**/*.js]",
"**/*.{css,html}"
],
"excludes" : [
"**/config.js"
]
},
My temptative 'exclude' statement doesn't do the trick
Solution is actually given on the GitHub page: https://github.com/aurelia/cli
Optionally, you can define an exclude list by setting the source
property to be an object containing both an include and exclude array
of patterns. This is helpful when you're trying to define multiple
bundles from your source code.
{
"name": "app-bundle.js",
"source": {
"include": [
"[**/*.js]",
"**/*.{css,html}"
],
"exclude": [
"**/sub-module/**/*",
]
}
},
{
"name": "sub-module-bundle.js",
"source": [
"**/sub-module/**/*",
]
}
Make sure you have version > 0.19.0
When I try to create an aurelia bundle and one already exists, I get an error basically saying it failed because a file already exists. The problem is that my force:true is set. Any help with this would be greatly appreciated.
var gulp = require('gulp'),
aureliaBundle = require('aurelia-bundler').bundle;
var aureliaBundleConfig = {
"force": true,
"baseUrl": ".",
"configPath": "js/config.js",
"bundles": {
"js/aurelia-bundle.min": {
"includes": [
"[js/**/*.js]",
"Templates/**/*.html!text"
],
"options": {
"inject": true,
"minify": true,
"depCache": false
}
},
"js/vendor-bundle": {
"includes": [
"lib/github/components/jquery#2.2.4",
"lib/github/signalr/bower-signalr#2.2.0",
"lib/npm/aurelia-bootstrapper#1.0.0-rc.1.0.1",
"lib/npm/aurelia-fetch-client#1.0.0-rc.1.0.1",
"lib/npm/aurelia-framework#1.0.0-rc.1.0.2",
"lib/npm/aurelia-router#1.0.0-rc.1.0.1",
"lib/npm/aurelia-animator-css#1.0.0-rc.1.0.0",
"lib/npm/aurelia-http-client#1.0.0-rc.1.0.0",
"lib/npm/aurelia-kendoui-bridge#0.11.8",
"lib/npm/aurelia-event-aggregator#1.0.0-rc.1.0.0",
"lib/npm/aurelia-templating-binding#1.0.0-rc.1.0.1",
"lib/npm/aurelia-templating-resources#1.0.0-rc.1.0.1",
"lib/npm/aurelia-templating-router#1.0.0-rc.1.0.1",
"lib/npm/aurelia-templating#1.0.0-rc.1.0.1",
"lib/npm/aurelia-loader-default#1.0.0-rc.1.0.0",
"lib/npm/aurelia-history-browser#1.0.0-rc.1.0.0",
"lib/npm/aurelia-logging-console#1.0.0-rc.1.0.0"
],
"options": {
"inject": true,
"minify": true,
"depCache": false
}
}
}
};
gulp.task('bundle:aurelia', function () {
return aureliaBundle(aureliaBundleConfig);
});