Webpack loader for semantic-ui-less modules Can be used with semantic-ui-react-less-loader.
npm install semantic-ui-react semantic-ui-less --save-dev
npm install semantic-ui-less-module-loader --dev
Add to your root js component:
import 'semantic-ui-less/definitions/globals/reset.less';
import 'semantic-ui-less/definitions/globals/site.less';
Add loaders for semantic-ui-less modules and it's assets in your webpack config:
module: {
loaders: [
// less-loader
{
test: /\.less$/,
loader: ExtractTextPlugin.extract('style', 'css?!postcss!semantic-ui-less-module'),
include: [/[\/\\]node_modules[\/\\]semantic-ui-less[\/\\]/]
},
// loader for static assets
{
test: /\.(png|jpg|jpeg|gif|svg)$/,
loader: 'url?limit=10240&absolute&name=images/[path][name]-[hash:7].[ext]',
include: [/[\/\\]node_modules[\/\\]semantic-ui-less[\/\\]/]
},
{
test: /\.(woff|woff2|ttf|svg|eot)$/,
loader: 'url?limit=10240&name=fonts/[name]-[hash:7].[ext]',
include: [/[\/\\]node_modules[\/\\]semantic-ui-less[\/\\]/]
}
]
},
// you can also add specific options:
semanticUiLessModuleLoader: {
siteFolder: path.join(__dirname, 'src/site'),
},
- defaultFolder (default: /path/to/node_modules/semantic-ui-less)
- siteFolder (default: ${defaultFolder}/_site)
- definitionsFolder (default: ${defaultFolder}/definitions)
- themesFolder (default: ${defaultFolder}/themes)
- themeConfigPath (default: ${defaultFolder}/theme.config.example)
- themePath (default: ${defaultFolder}/theme.less)
Add to your site/elements/flag.variables:
@spritePath: "../../themes/default/assets/images/flags.png";
Add to your site/globals/site.variables:
@imagePath : '../assets/images';
@fontPath : '../assets/fonts';