Skip to content

Commit 751c4d6

Browse files
committed
feat(scripts): add less support
Add built-in support for less. See #469
1 parent 21f5312 commit 751c4d6

File tree

13 files changed

+304
-85
lines changed

13 files changed

+304
-85
lines changed

β€Ž.gitignoreβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## Project specifics ##
2+
examples/tryouts
23

34
# Compiled libraries
45
packages/*/lib

β€Žexamples/plugin/package.jsonβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"cssnano": "^4.1.10",
1515
"eslint": "^5.16.0",
1616
"fork-ts-checker-webpack-plugin": "^1.0.2",
17+
"less": "^3.9.0",
1718
"node-sass": "^4.11.0",
1819
"prettier": "^1.17.0",
1920
"svgo": "^1.2.1",

β€Žexamples/plugin/src/app/index.jsβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/* eslint-disable no-console */
2-
import './index.css';
32
import imgURL from './image.png';
43
import logger from './modules/logger';
54
import svgURL from './svg.svg';
65

6+
import './index.css';
7+
import './style.less';
8+
79
console.log('Heres an URL of dynamically imported asset.');
810
console.log(imgURL);
911
console.log(svgURL);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.entry-content {
2+
background: #fff !important;
3+
position: relative;
4+
&::before {
5+
content: "Style set by less";
6+
display: block;
7+
font-style: italic;
8+
font-family: cursive;
9+
font-weight: bold;
10+
color: purple;
11+
font-size: 12px;
12+
position: absolute;
13+
top: 44px;
14+
left: -5px;
15+
transform: rotate(-90deg);
16+
}
17+
}

β€Žexamples/plugin/wpackio.project.jsβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ module.exports = {
186186
hasReact: true,
187187
// Needs sass?
188188
hasSass: true,
189+
// Needs less?
190+
hasLess: true,
189191
// Externals
190192
externals: {
191193
jquery: 'jQuery',

0 commit comments

Comments
Β (0)