
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Working title...
Build complete, wonderful, beautiful apps with one dependency. Compile to static HTML files with a single command.
yarn add --dev app-time
Add these scripts to package.json
:
{
"scripts": {
"start": "app-time start",
"build": "app-time build",
"setup": "app-time setup",
"eject": "app-time eject"
}
}
NOTE: This project comes with defaults that may work for your project. Configuration should only be necessary once you need to customize something or add features not included by default.
If you need more control over how App Time is configured you can provide one or both of apptime.config.dev.js
or apptime.config.prod.js
files at the root of your project. If either of these files is detected App Time will read it and use it to generate the final webpack configuration.
Each of these files is a lot like a standard webpack.config.js
file except that it is defined as a function which must return the final wepback configuration. This allows you to customize only parts of the webpack configuration while maintaining other benefits of this project.
If you wanted to specify an entry point for an app
bundle which included normalize.css
and font-awesome
you could create a apptime.config.dev.js
file at the root of your project like so:
// apptime.config.dev.js
module.exports = (config, defaults) => ({
...config,
entry: {
app: [
'normalize.css',
'font-awesome/css/font-awesome.css',
defaults.hmrEntry,
'./client/index.js',
],
},
});
defaults.hmrEntry
is the entry point that allows hot reloading to function, so be sure to include it.
apptime.config.js
:start
Start a dev server at localhost:3000
You can also start the dev server using webpack-dashboard using the --dashboard
flag. Example:
app-time start --dashboard
NOTE: There is no preferred way to run the dev server. If you like the dashboard then use it. If it's too much for you then stick to the minimal default version 😁.
build
Compile all project assets and generate static HTML files for each route in your react-router config.
You can also generate a build report as well as a JSON stats file from the production webpack build using the --analyze
flag. Example:
app-time build --analyze
This will generate an HTML report to webpack-bundle-analyzer-report.html
as well as a stats file to webpack-bundle-analyzer-stats.json
.
setup
app-time uses the Webpack DLL plugin for super fast hot reloading. In order to do this Webpack needs to pre-compile the DLL file with your vendor dependencies. This is what app-time setup
does. It's often convenient to place this script in the postinstall
NPM hook so that Webpack will recompile your DLL file whenever you add new dependencies.
You can configure what libraries are included in the DLL using the apptime.vendorLibs
field in your package.json
. Example:
"apptime": {
"vendorLibs": [
"react",
"react-dom",
"react-router"
]
}
app-time has some sane defaults for the vendorLib
array but as you add more dependencies it would be a good idea to update this list.
eject
Bring all configuration files in to your own app and remove the app-time dependency. This action cannot be undone, but you will find it useful if you need to do some really custom configuration. In that case app-time functions like a Webpack boilerplate—getting everything set up initially and then letting you take it from there.
Create React App is a similar project and does a good job of explaining "eject": https://github.com/facebookincubator/create-react-app#converting-to-a-custom-setup
If you just want to see what eject
would do without the commitment you can pass the --dry-run
flag and no files will actually be moved or written:
app-time eject --dry-run
This project is under active development and this is just the initial version. There are still many things missing which would likely make it more appealing to a wider audience.
FAQs
_Working title..._
The npm package app-time receives a total of 2 weekly downloads. As such, app-time popularity was classified as not popular.
We found that app-time demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.