Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add built in option for less support #469

Closed
6 tasks done
swashata opened this issue Apr 27, 2019 · 0 comments
Closed
6 tasks done

Add built in option for less support #469

swashata opened this issue Apr 27, 2019 · 0 comments
Assignees
Labels
good first issue Good for newcomers Priority: Medium Status: Available awaiting release Type: Feature New feature or request

Comments

@swashata
Copy link
Owner

swashata commented Apr 27, 2019

Many popular libraries like antd, elemental ui uses less. So we should have it built in. Right now, once can do it like

const webpackConfigWithLess = (config, merge, appDir, isDev) => {
	const configWithLess = {
		module: {
			rules: [
				{
					test: /\.less$/,
					use: [
						isDev
							? 'style-loader'
							: {
									loader: MiniCssExtractPlugin.loader,
									options: {
										sourceMap: true,
									},
							  },
						{
							loader: 'css-loader',
							options: {
								importLoaders: 1,
								sourceMap: true,
							},
						},
						{
							loader: 'postcss-loader',
							options: {
								sourceMap: true,
							},
						},
						{
							loader: 'less-loader',
							options: {
								sourceMap: true,
							},
						},
					],
				},
			],
		},
	};

	return merge(config, configWithLess);
};

Tasks

  • Add prompt Does your project require less.
  • Add hasLess in project config, defaulting to undefined which would behave as false.
  • Add less-loader in project.
  • Add less in devDependencies of the user if hasLess.
  • Add less-loader if needed.
  • Turn on inlineJs of less-loader because antd needs it that way.
@swashata swashata self-assigned this Apr 27, 2019
swashata added a commit that referenced this issue Apr 28, 2019
Add built-in support for less.

See #469
@swashata swashata added Status: Available awaiting release and removed Status: In Progress labels Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Priority: Medium Status: Available awaiting release Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant