Webpack Publicpath

webpack 개념 3. Checkout webpack's entry naming configuration. { output: { publicPath: "/dist/" } } This is needed so that Webpack can know where to load the files from. js, webpack. OK, I Understand. js and jquery. My issue was the incorrect dependency between packages after I upgraded each package to the latest version of the Nativescript (3. js from CDN, how i should write this publicPath property ? I am so confused. You can use publicPath to point to the location where you want webpack-dev-server to serve its "virtual" files. In addition to the options actually used by this plugin, you can use this hash to pass arbitrary data through to your template. Harnessing Webpack with Visual Studio Code Last Updated: 7/24/2016 Within an older blog post, entitled "Webpackin' your ES 2015 / Angular 1. This is the first in a series about Remix's tech stack. For the client side scripts we used the CommonJS module format, but Webpack can also work with AMD modules. Whenever Webpack 2 comes out, it will support ES6/ES2015 modules natively. Angular CLI's build command's --deploy-url is actually setting the Webpack config output. It runs a full Node. In addition to the options actually used by this plugin, you can use this hash to pass arbitrary data through to your template. Think of Webpack's Hot Module Replacement (HMR) feature as an evolution of Webpack Dev Middleware. NET Core and Angular. productionSourceMap. Let’s run the same exercise with the a webpack manifest file. OK, I Understand. Whether to generate source maps for production build. This gives us long-term caching because of unique filenames; We prefix the publicPath with a CDN URL. webpack is fed a configuration object. Both the client and the server side of the application is implemented inside one ASP. You will learn everything about the tooling around React. quiet 🔑 boolean. We want to have a way of connecting the code that's been generated by webpack and the code that we've written. For example, instead of modifying output. This also means that errors or warnings from webpack are not visible. Manipulating file-loader Output Path and publicPath # As discussed above and in webpack issue tracker, file-loader allows shaping the output. The webpack-dev-server also takes a hint from publicPath, using it to determine where to serve the output files from. Whenever Webpack 2 comes out, it will support ES6/ES2015 modules natively. The one entry point file in this example is the application's root file, src/main. js like in create-react-app? Thanks for the great synopsis btw, useful info. 但是自己折腾了半天,包括: 【已解决】wepack打包时出错:Module parse failed jpg Unexpected character. If you are using publicPath in webpack's output object, make sure you either remove it or update to match your server build path. For example, instead of modifying output. html and we’re off. Also install webpack globally (npm i -g webpack) if you haven't already—it'll make compiling simpler unless you set up NPM scripts. js , and will look into loadable-stats. NET web applications. Entries and outputs. webpack 개념 5. Simple use. js; instead of modifying output. But if you've ever had the joy of working with React and react-hot-loader you know you need to have that with you anywhere. x (for longer than I'd like to admit) it all suddenly clicked. Let's talk a little about this folder structure and the files contained in the default webpack-simple vue-cli project. js and should not be mutated directly. You will learn everything about the tooling around React. Note that [hash] in this parameter will be replaced with an hash of the compilation. An Annotated webpack 4 Config for Frontend Web Development As web devel­op­ment becomes more com­plex, we need tool­ing to help us build mod­ern web­sites. 但是自己折腾了半天,包括: 【已解决】wepack打包时出错:Module parse failed jpg Unexpected character. For the client side scripts we used the CommonJS module format, but Webpack can also work with AMD modules. From this module, webpack can infer which other modules or libraries the application depends on and include them in your bundle. Note: To learn more about webpack, please refer to the concepts and guides pages from webpack. NET Core project which makes it easier to deploy. I’m planning a big React web development course. I also provide a boilerplate to start developing right away. It can auto detect source control from Git/Mercurial repos and from projects with a package. In this article we will learn how to set up a React project using Webpack, Node. I resolved my issue with slack community help. By default amCharts contains support for exporting charts. Checkout webpack's entry naming configuration. publicPath默认指向环境地址,所以暂且不说;. Special discount for subscribers: Purchase full course at $9. Specifies the publicPath of the webpack, pointing to the path where the static resource file is located. 我们已经知道了设置了file-loader下的publicPath就是css文件与js文件引入图片的路径,因为css和js引入的机制不同,我们只需要将css文件打包之后与html同级即可. How to use Maven to initiate the Webpack and put the bundles to the right place in the. Think of Webpack's Hot Module Replacement (HMR) feature as an evolution of Webpack Dev Middleware. Get off my lawn! The crotchety old man inside me gets. By default it is an in memory bundle which is not written on disk and if you want to output it to a dist folder, you can specify it here. publicPath doc (Note: I used /assets/ to keep with the example in the docs. What's next? There is a lot more you can do with this, for example the --env variable can be an object instead, so you could pass more config inside it for additional build settings. e the names of the bundles. While fileName is used for independent entry bundles, chunkFilename is used for bundles that are auto-generated by Webpack during code splitting. Webpack: Paths and Naming 3 minute read TIL the difference between path and publicPath in webpack, and how the output. # publicPath. By using loaders, you can also add ES6 to ES5. The webpack-dev-server also takes a hint from publicPath, using it to determine where to serve the output files from. start setting in package. filename property can be used to assign files to sub-directories in the path. After adding these configuration variables, Kent spends a few minutes answering audience questions and reviewing the build process. html and we’re off. exports = (env) => { output: { filename: '[name]. In this post I will show you how to build and understand a webpack config file for developing applications with react, react–router and redux. json to confirm it's there. js; instead of modifying output. __webpack_require__. Whenever Webpack 2 comes out, it will support ES6/ES2015 modules natively. js and should not be mutated directly. yarn add --dev webpack extract-text-webpack-plugin css-loader file-loader postcss postcss-loader postcss-cssnext postcss-import. This way you can output your fonts below fonts/, images below images/, and so on over using the root. 这篇文章主要给大家介绍了webpack学习教程之publicPath路径问题的相关资料,文中通过示例代码介绍的非常详细,对大家具有一定的参考学习价值,需要的朋友们下面来一起看看吧。. webpack 中 output. js from CDN, how i should write this publicPath property ? I am so confused. 🌋 Pluggable enterprise-level react application framework. Name of chunk files is decided by Webpack while compilation but we can modify it inside webpack. Through the series, you will learn the basics of webpack, before moving on to more advanced topics such as building plugins and creating custom Vue and React setups. webpack is a module bundler. If you set publicPath a value begin with /http(s):/, then static middleware shouldn't on. In this article we'll explore how pre-rendering works with Vue. Also, any changes made to source file [ index. js and should not be mutated directly. Webpack transforms the code when bundling our modules and outputting them. The webpack-simple vue-cli folder structure. Specifies the publicPath of the webpack, pointing to the path where the static resource file is located. When importing the components like this (using webpack vue-loader) I get the warning that the Modules are not installed: "Go To Declaration" also doesn't work. webpack 개념 3. Think of Webpack's Hot Module Replacement (HMR) feature as an evolution of Webpack Dev Middleware. # publicPath. In this tutorial, we will explore how. Optimizing React + ES6 + Webpack Production Build December 17, 2015 2017-11-19T22:25:57+0000 DevOps Writing a web application in React using the ES6 awesomeness and spiced up with Webpack has got to be very close to the perfect project for any web developer. If you're like me, then you've struggled with configuring webpack for your React app. Furthermore, it's possible to manipulate publicPath and override the default per loader definition. Webpack is great when it works. js instead of your server. # publicPath. I haven't tried to webpack the server but I hear doing so works great for this. start setting in package. npm install webpack -g. Only change this if your backend framework serves static assets with a path prefix. Sass is a very popular CSS pre-processor. js and Typescript. Notice about webpack’s output -> publicPath configuration. options include: exclude, type is Array(RegExp), used to ignore certain routes, such as using dva, usually need to ignore the models, components, services, etc. Create-react-app (CRA) ships with webpack already under the hood, but usually we would need to add more configurations as our app grows. json to confirm it's there. __webpack_require__. Create a new file with common webpack options and use it in both inside the main webpack config and inside Storybook's webpack. We'll get to that in a minute. You will learn everything about the tooling around React. js in the project root folder. Both the client and the server side of the application is implemented inside one ASP. Webpack 3, Dynamic Imports, Code Splitting, and Long Term Caching… Made Easy. If you already know how to set up webpack and wish to learn more on building and understanding react apps, see this post. { output: { publicPath: "/dist/" } } This is needed so that Webpack can know where to load the files from. 이전 강좌의 코드를 활용합니다. webpack-hot-middleware is used for running a webpack dev server with HMR inside an express server. webpack 개념 5. Development Webpack config for "Building a JavaScript Development Environment" on Pluralsight - webpack. While we focused on React in the example above, surely this technique will prove fruitful in your Angular apps as well. 例: 有一个通过 require. Depending on your usage of webpack there are two ways to pass this configuration object: CLI. js in your index. This technique is valuable if you don't know it compile-time and want to decide it later. It is, however, not easy to get started with this framework. start setting in package. publicPath, but Vue CLI also needs this value for other purposes, so you should always use publicPath instead of modifying webpack output. Example merging the loaders from your app's webpack. js , and will look into loadable-stats. js with Webpack is extremely easy if you want to build your project from scratch. jsに以下のように記述して、 webpack. In this article we'll explore how pre-rendering works with Vue. Webpack — Understanding the ‘publicPath’ mystery. I use nodemon to monitor my back end files so I can make changes and restart the node process, but remember to exclude your client-side files so webpack-dev-middleware can take care of them instead. Webpack, a module bundler, is a powerful tool that helps you to develop complex web applications. png)와 같이 url을 볼 수 있는데, publicPath가 이를 처리해 줍니다. I wanted to use it in another application via NPM. You supply Webpack with one or more entry files and let it find and incorporate the dependencies that radiate from those entries. Now go to the command prompt and run webpack from the folder where you webpack. quiet: true devServer. public/ now, in the import itself, does that mean I will have to reference the public folder locally? ie. path构build源文件到 dist 文件夹。. In this video I cover how to set everything up on Windows 10 including : Node, HomeBrew, React, Express, Popper. PR's welcome! Using Webpack bundled assets with the Rails Asset Pipeline. A lot has been happening lately in the. js from CDN, how i should write this publicPath property ? I am so confused. For example, instead of modifying output. Now we just need to include the bundle. webpack output is served from /js/aaa/ Content not from webpack is served from dist. SpaServices NuGet package. Getting started with Webpack Ahead-of-Time Configuration To quick start with Syncfusion JavaScript Angular components run the below commands to clone the repository for Webpack starter and installing required dependency packages. If you're not sure which to choose, learn more about installing packages. js and should not be mutated directly. you need to add a publicPath key to your existing output object and set it to the PUBLIC_PATH const defined earlier. The critical portion of creating your application is going to be your webpack. I wanted to serve my updates from a different URI, which would only be known at run time. Now we just need to include the bundle. You will learn everything about the tooling around React. This file is what Yarn uses to lock down the exact dependencies to use on another machine, you don't really have to worry about this file as it. MIT · Repository · Bugs · Original npm · Tarball · package. EU customers: Price excludes VAT. Not for general use. The Non-Way. resolve(__dirname, '. In a nutshell, Webpack is a bundle system. 对于output的publicPath来说,虽然也看了很多: 【部分解决】Webpack中output中publicPath的作用. Abstract: This article explores the official Microsoft template for ASP. How to use Maven to initiate the Webpack and put the bundles to the right place in the. Essentially, as Webpack is compiling your code, it is looking for the string, process. Webpack transforms the code when bundling our modules and outputting them. Webpack will gather all code in your program and pack it up ready-to-use format for the end user's web br. lock is created. js (or the file passed by the --config option). webpack is fed a configuration object. Installation npm i dynamic-public-path-webpack-plugin --save-dev Usage 1. js we need to understand what is Webpack. HTML preprocessors can make writing HTML more powerful or convenient. json that drives the running process for the app "scripts": { "sta…. In this tutorial, we will explore how. In the standard HMR approach where webpack-dev-server is serving the updates, the URI used by HMR is hardcoded in the Webpack configuration file (publicPath). Webpack has seen a lot of use due to how customizable and powerful it is. filename property can be used to assign files to sub-directories in the path. publicPath to /dist/ in the webpack config. loaders , so you can change the options of loaders inside extend. webpack 강좌 3. libraryExport. And that's not really surprising because webpack is a very flexible and powerful build tool. Webpack enables developers to bundle and build the client-side resources of a web app. Next, we need to install webpack and a few dependencies. dynamic-public-path-webpack-plugin. js', publicPath: '/dist/' // Webpack dev middleware, if enabled, handles requests for this URL prefix }, Hot Module Replacement. In webpack. It has been a year since I first got into React and Webpack. Sass is a very popular CSS pre-processor. In addition to the options actually used by this plugin, you can use this hash to pass arbitrary data through to your template. js in your index. I have many times expressed that Webpack is amazing, but hard to configure. The webpack-simple template is about as basic of a webpack setup as you can get away with for Vue. Going PWA allows your users to save a subset of your website directly on their mobile device to be able to use it off-line. 但是却没有得到想要的那种效果: webpack自动把url的地址,改为publicPath的地址。. PackagesDetails. Where as “publicPath” is used by several Webpack’s plugins to update the URLs inside CSS, HTML files when generating production builds. You can view the table of contents here React for Embereños At the Flatiron school, we've been gearing up to teach students to. In our case, we had specified a single "entry" file and a single "bundle" (output) file. 설정 Configuration. Download the file for your platform. NET Core SignalR with TypeScript and Webpack. js environment and already has all of npm's 400,000 packages pre-installed, including worker-loader with all npm packages installed. This doc is for you. By Sébastien Sougnez and Scott Addie. webpack is a module bundler. js (which resides in the same directory as webpack. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. This one goes along with the webpack one, and it is reloading the server. A publicPath variable must also be specified so the Webpack Dev Server knows the location of the files on the server. What's next? There is a lot more you can do with this, for example the --env variable can be an object instead, so you could pass more config inside it for additional build settings. js and should not be mutated directly. js and ext-react/ext. Note: To learn more about webpack, please refer to the concepts and guides pages from webpack. This ten-part tutorial series provides a comprehensive introduction to webpack. htmlWebpackPlugin. It is recommended that devServer. js file to use as an entry point. I decided to move the New configs into separate folders /configs. publicPath is the same as output. Webpack has been initialised using a configuration object that does not match the API sche ma. Gulp has been a popular task automation toolkit in the frontend web development space for some time now. If you use the prerender-loader with Webpack 3, it currently doesn’t work with the ExtractTextPlugin. HTML preprocessors can make writing HTML more powerful or convenient. publicPath: '/media/webpack/', } } Generated ext. Whenever Webpack sees import() function, it is going to create an async chunk file. In our case, we had specified a single "entry" file and a single "bundle" (output) file. Now webpack will serve files from localhost:3000/dist and your extension should load correctly. NET Core Angular Lazy Loading with Webpack 2 Hot Module Replacement with Angular…. The webpack-dev-server also takes a hint from publicPath, using it to determine where to serve the output files from. js in the project root folder. Progressive Web App with Webpack. The publicPath property configures the relative URL that the browser will use to reference our bundles. You can use publicPath to point to the location where you want webpack-dev-server to serve its "virtual" files. This makes config easier. The publicPath property defines the location where Webpack looks for the created files. 其它 Webpack 学习资源 2-8 整体配置结构 之前的章节分别讲述了每个配置项的具体含义,但没有描述它们所处的位置和数据结构,下面通过一份代码来描述清楚:. I've remixed a project setup for running webpack-dev-server and another one with a node server, it seems as it's the scripts. However, in non-production mode we override. npm install webpack -g. webpack will hotload any JavaScript changes as you make them without the need to refresh your browser. Progressive Web App with Webpack. If you are used to running the webpack CLI or the Webpack API (without express or webpack-dev-server), then you'll have to change how you do things a little bit. Some others are Angular and Vue. js like in create-react-app? Thanks for the great synopsis btw, useful info. Ben Nadel just discovered that Webpack 4 will implicitly use the DefinePlugin to automatically replace the substring, "process. path from the view of the JavaScript. An elegant wrapper around Webpack for the 80% use case. publicPath, you should use the publicPath option in vue. Webpack enables developers to bundle and build the client-side resources of a web app. webpack 是以 commonJS 的形式来书写脚本滴,但对 AMD/CMD 的支持也很全面,方便旧项目进行代码迁移 所有静态资源都可以被当成模块引用,而不仅仅是JS了 开发便捷,能替代部分 grunt/gulp 的工作,比如打包、压缩混淆、图片转base64等. publicPath specified in the HTML when the. Webpack will do the rest and generate extra chunk files and load them for you. In this article we'll explore how pre-rendering works with Vue. The publicPath property specifies what directory the bundle should go in, and also tells webpack-dev-server where to serve files from. publicPath, but Vue CLI also needs this value for other purposes, so you should always use publicPath instead of modifying webpack output. const publicPath = '/'; // `publicUrl` is just like `publicPath`, but we will provide it to our app // as %PUBLIC_URL% in `index. If this is set. 설정 Configuration. Webpack will assume that those files are in your root directory when you load then into a html script tag for example. Whether to generate source maps for production build. With Webpack 4 and mini-css-extract-plugin the prerender-loader is able to extract the CSS to a different file, which is much better. js like in create-react-app? Thanks for the great synopsis btw, useful info. publicPath dynamically. loaders in extend loaders has the same object structure as build. If you're not sure which to choose, learn more about installing packages. For the client side scripts we used the CommonJS module format, but Webpack can also work with AMD modules. json file to the root of your projects directory with the following npm init command or copy and save the snippet below as your package. If you use the CLI it will read a file webpack. By Sébastien Sougnez and Scott Addie. html and we’re off. You can use publicPath to point to the location where you want webpack-dev-server to serve its "virtual" files. The previous tutorials have shown you how to set up a basic web application with Webpack 4. webpack is fed a configuration object. png)와 같이 url을 볼 수 있는데, publicPath가 이를 처리해 줍니다. publicPath is the same as output. The publicPath property specifies what directory the bundle should go in, and also tells webpack-dev-server where to serve files from. resolve(__dirname, '. Specifies the publicPath of the webpack, pointing to the path where the static resource file is located. Injects themselves into the build process to make all sort of crazy things. loaders , so you can change the options of loaders inside extend. The publicPath property configures the relative URL that the browser will use to reference our bundles. Workbox webpack Plugins Workbox provides two webpack plugins: one that generates a complete service worker for you and one that generates a list of assets to precache that is injected into a service worker file. publicPath 是很重要的选项。如果指定了一个错误的值,则在加载这些资源时会收到 404 错误。. webpack will hotload any JavaScript changes as you make them without the need to refresh your browser. Je rencontre un problème avec la mise en place de Webpack Encore dans mon projet Symfony 3. Depending on your usage of webpack there are two ways to pass this configuration object: CLI. exports = (env) => { output: { filename: '[name]. Webpack: Configuring webpack-dev-server 3 minute read TIL how to configure webpack-dev-server (WDS) to both serve files from the publicPath and proxy APIs on different domains to avoid cross site request warnings in the browser. json file when…. NET Ecosystem! For example, consider the. 가이드를 계속 따라오고 있다면, 웹팩 기초에 대한 확실한 이해가 있을 것입니다. __webpack_require__. HMR requires a server to work. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset. js with storybook's. While fileName is used for independent entry bundles, chunkFilename is used for bundles that are auto-generated by Webpack during code splitting. webpack-dev-server creates virtual files that it will use when you start it. Webpack is a module bundler. webpack 강좌 3. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. x+ no longer puts Webpack generated files through the asset pipeline. ejs ├─package. In this video I cover how to set everything up on Windows 10 including : Node, HomeBrew, React, Express, Popper. Here we configured webpack to set static/bundles/ as publicPath because the build files will be stored in assets/bundles and /static/ url points to the assets directory. Has anyone else managed this? I have an older stack which I am trying to upgrade, my target is this Ubuntu 18. This NPM package is an internal implementation detail of the Microsoft. I decided to move the New configs into separate folders /configs. Go to your shell page remove all references to all JS file and just add reference of the main startup bundle and there you are live on production. js instead of your server. NET Core SignalR with TypeScript and Webpack. publicPath和webpack-dev-server中publicPath的问题,而官方文档对它们的描述也不是很清楚,所以自己研究了下并写下本文记录。. options include: exclude, type is Array(RegExp), used to ignore certain routes, such as using dva, usually need to ignore the models, components, services, etc. How to use Maven to initiate the Webpack and put the bundles to the right place in the. It is recommended that devServer. yarn add webpack babel-core babel-loader babel-preset-es2015 babel-preset-react ts-loader webpack-dev-server At this point I have to thank Tom Duncalf, whose blog post on TypeScript 1. This also means that errors or warnings from webpack are not visible. However, there is still an underlying dearth of a good example of the best. webpack-node-externals is a function that scans your node_modules and ensures that they aren't transpiled and bundled along with your front-end code, though it ensures the bundle retains reference to them. Let us learn about webpack's publicPath option. Use the window. If you set publicPath a value begin with /http(s):/, then static middleware shouldn't on. x SPA", I explained how to use npm scripts to execute Webpack commands. The fact-checkers, whose work is more and more important for those who prefer facts over lies, police the line between fact and falsehood on a day-to-day basis, and do a great job. Today, my small contribution is to pass along a very good overview that reflects on one of Trump’s favorite overarching falsehoods. Namely: Trump describes an America in which everything was going down the tubes under  Obama, which is why we needed Trump to make America great again. And he claims that this project has come to fruition, with America setting records for prosperity under his leadership and guidance. “Obama bad; Trump good” is pretty much his analysis in all areas and measurement of U.S. activity, especially economically. Even if this were true, it would reflect poorly on Trump’s character, but it has the added problem of being false, a big lie made up of many small ones. Personally, I don’t assume that all economic measurements directly reflect the leadership of whoever occupies the Oval Office, nor am I smart enough to figure out what causes what in the economy. But the idea that presidents get the credit or the blame for the economy during their tenure is a political fact of life. Trump, in his adorable, immodest mendacity, not only claims credit for everything good that happens in the economy, but tells people, literally and specifically, that they have to vote for him even if they hate him, because without his guidance, their 401(k) accounts “will go down the tubes.” That would be offensive even if it were true, but it is utterly false. The stock market has been on a 10-year run of steady gains that began in 2009, the year Barack Obama was inaugurated. But why would anyone care about that? It’s only an unarguable, stubborn fact. Still, speaking of facts, there are so many measurements and indicators of how the economy is doing, that those not committed to an honest investigation can find evidence for whatever they want to believe. Trump and his most committed followers want to believe that everything was terrible under Barack Obama and great under Trump. That’s baloney. Anyone who believes that believes something false. And a series of charts and graphs published Monday in the Washington Post and explained by Economics Correspondent Heather Long provides the data that tells the tale. The details are complicated. Click through to the link above and you’ll learn much. But the overview is pretty simply this: The U.S. economy had a major meltdown in the last year of the George W. Bush presidency. Again, I’m not smart enough to know how much of this was Bush’s “fault.” But he had been in office for six years when the trouble started. So, if it’s ever reasonable to hold a president accountable for the performance of the economy, the timeline is bad for Bush. GDP growth went negative. Job growth fell sharply and then went negative. Median household income shrank. The Dow Jones Industrial Average dropped by more than 5,000 points! U.S. manufacturing output plunged, as did average home values, as did average hourly wages, as did measures of consumer confidence and most other indicators of economic health. (Backup for that is contained in the Post piece I linked to above.) Barack Obama inherited that mess of falling numbers, which continued during his first year in office, 2009, as he put in place policies designed to turn it around. By 2010, Obama’s second year, pretty much all of the negative numbers had turned positive. By the time Obama was up for reelection in 2012, all of them were headed in the right direction, which is certainly among the reasons voters gave him a second term by a solid (not landslide) margin. Basically, all of those good numbers continued throughout the second Obama term. The U.S. GDP, probably the single best measure of how the economy is doing, grew by 2.9 percent in 2015, which was Obama’s seventh year in office and was the best GDP growth number since before the crash of the late Bush years. GDP growth slowed to 1.6 percent in 2016, which may have been among the indicators that supported Trump’s campaign-year argument that everything was going to hell and only he could fix it. During the first year of Trump, GDP growth grew to 2.4 percent, which is decent but not great and anyway, a reasonable person would acknowledge that — to the degree that economic performance is to the credit or blame of the president — the performance in the first year of a new president is a mixture of the old and new policies. In Trump’s second year, 2018, the GDP grew 2.9 percent, equaling Obama’s best year, and so far in 2019, the growth rate has fallen to 2.1 percent, a mediocre number and a decline for which Trump presumably accepts no responsibility and blames either Nancy Pelosi, Ilhan Omar or, if he can swing it, Barack Obama. I suppose it’s natural for a president to want to take credit for everything good that happens on his (or someday her) watch, but not the blame for anything bad. Trump is more blatant about this than most. If we judge by his bad but remarkably steady approval ratings (today, according to the average maintained by 538.com, it’s 41.9 approval/ 53.7 disapproval) the pretty-good economy is not winning him new supporters, nor is his constant exaggeration of his accomplishments costing him many old ones). I already offered it above, but the full Washington Post workup of these numbers, and commentary/explanation by economics correspondent Heather Long, are here. On a related matter, if you care about what used to be called fiscal conservatism, which is the belief that federal debt and deficit matter, here’s a New York Times analysis, based on Congressional Budget Office data, suggesting that the annual budget deficit (that’s the amount the government borrows every year reflecting that amount by which federal spending exceeds revenues) which fell steadily during the Obama years, from a peak of $1.4 trillion at the beginning of the Obama administration, to $585 billion in 2016 (Obama’s last year in office), will be back up to $960 billion this fiscal year, and back over $1 trillion in 2020. (Here’s the New York Times piece detailing those numbers.) Trump is currently floating various tax cuts for the rich and the poor that will presumably worsen those projections, if passed. As the Times piece reported: