From 3e0489bec37e01db6e6931357dd5d2d66e5a7275 Mon Sep 17 00:00:00 2001 From: Vladimir Tazin Date: Wed, 30 Nov 2016 18:43:11 +0300 Subject: [PATCH] Add description to readme for https://github.com/Semantic-Org/Semantic-UI-LESS/issues/14 fix --- README.md | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 14ca84f..1f2c849 100644 --- a/README.md +++ b/README.md @@ -14,15 +14,29 @@ npm install semantic-ui-less-module-loader --dev ### Configuration -Add loader for semantic-ui-less modules in your webpack config: +Add loaders for semantic-ui-less modules and it's assets in your webpack config: ```js module: { loaders: [ + + // less-loader { test: /\.less$/, loader: ExtractTextPlugin.extract('style', 'css?!postcss!semantic-ui-less-module'), - include: [/node_modules[\/\\]semantic-ui-less/] + 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[\/\\]/] } ] }, @@ -41,4 +55,15 @@ semanticUiLessModuleLoader: { - definitionsFolder (default: ${defaultFolder}/definitions) - themesFolder (default: ${defaultFolder}/themes) - themeConfigPath (default: ${defaultFolder}/theme.config.example) -- themePath (default: ${defaultFolder}/theme.less) \ No newline at end of file +- themePath (default: ${defaultFolder}/theme.less) + +#### To fix https://github.com/Semantic-Org/Semantic-UI-LESS/issues/14 + +Add to your site/globals/site.variables: + +```less + +@imagePath : '../assets/images'; +@fontPath : '../assets/fonts'; + +``` \ No newline at end of file