Skip to content

Commit

Permalink
feat(scripts): add less support
Browse files Browse the repository at this point in the history
Add built-in support for less.

See #469
  • Loading branch information
swashata committed Apr 28, 2019
1 parent 21f5312 commit 751c4d6
Show file tree
Hide file tree
Showing 13 changed files with 304 additions and 85 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Project specifics ##
examples/tryouts

# Compiled libraries
packages/*/lib
Expand Down
1 change: 1 addition & 0 deletions examples/plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"cssnano": "^4.1.10",
"eslint": "^5.16.0",
"fork-ts-checker-webpack-plugin": "^1.0.2",
"less": "^3.9.0",
"node-sass": "^4.11.0",
"prettier": "^1.17.0",
"svgo": "^1.2.1",
Expand Down
4 changes: 3 additions & 1 deletion examples/plugin/src/app/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* eslint-disable no-console */
import './index.css';
import imgURL from './image.png';
import logger from './modules/logger';
import svgURL from './svg.svg';

import './index.css';
import './style.less';

console.log('Heres an URL of dynamically imported asset.');
console.log(imgURL);
console.log(svgURL);
Expand Down
17 changes: 17 additions & 0 deletions examples/plugin/src/app/style.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.entry-content {
background: #fff !important;
position: relative;
&::before {
content: "Style set by less";
display: block;
font-style: italic;
font-family: cursive;
font-weight: bold;
color: purple;
font-size: 12px;
position: absolute;
top: 44px;
left: -5px;
transform: rotate(-90deg);
}
}
2 changes: 2 additions & 0 deletions examples/plugin/wpackio.project.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ module.exports = {
hasReact: true,
// Needs sass?
hasSass: true,
// Needs less?
hasLess: true,
// Externals
externals: {
jquery: 'jQuery',
Expand Down
Loading

0 comments on commit 751c4d6

Please sign in to comment.