
Product
Introducing Custom Tabs for Org Alerts
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.
@moped/rule-css
Advanced tools
This module provides a sensible rule for handling css in webpack applications. It is part of the moped suite of utilities for creating composable configs for building node.js and react apps.
This module provides a sensible rule for handling css in webpack applications. It is part of the moped suite of utilities for creating composable configs for building node.js and react apps.
In development, css is included inline in the JavaScript bundle. In production, the css is extracted into a separate file. For this reason, the return value consists of a rule and a plugin.
yarn add --dev @moped/rule-css
const createCssRule = require('@moped/rule-css');
const css = createCssRule({
environment: process.env.NODE_ENV,
cssFileName: 'index.css',
shouldUseRelativeAssetPaths: false,
disableSourceMaps: false,
});
module.exports = {
entry: __dirname + '/src/index.js',
output: {
path: __dirname + '/build',
filename: 'index.js',
publicPath: '/',
},
module: {
rules: [css.rule],
},
plugins: [css.plugin].filter(plugin => plugin !== null),
};
This can be 'development', 'production' or 'test'. If you don't provide it, it will default to the value of NODE_ENV. If neither are specified, an exception will be thrown. It will also throw an exception if any value other than 'development', 'production' and 'test' is used.
This is the name of the generated css file, relative to the build folder. It defaults to 'static/css/[name].[contenthash:8].css'. The [name] and [contenthash:8] tokens will be replaced with appropriate values.
If you're not yet sure what the public path of your app will be. i.e. you don't know if it will be at https://example.com/ or https://example.com/foo/bar, you can use relative paths to ensure that the app always works. N.B. this will break if you are using client side routing using push state (e.g. react-router). You should only enable this if you're sure you need it.
If you are building a very large application, generating source maps may become too slow, and might not be worth it. You can use this option to disable source maps. You can alternatively set the GENERATE_SOURCEMAP environment variable to false (this option is for compatibility with create-react-app).
MIT
FAQs
This module provides a sensible rule for handling css in webpack applications. It is part of the moped suite of utilities for creating composable configs for building node.js and react apps.
The npm package @moped/rule-css receives a total of 1 weekly downloads. As such, @moped/rule-css popularity was classified as not popular.
We found that @moped/rule-css 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.

Product
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.