Skip to content

Commit 1379eba

Browse files
committed
fix compilation problem
1 parent 90973d2 commit 1379eba

File tree

3 files changed

+62
-1
lines changed

3 files changed

+62
-1
lines changed

package-lock.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/tdb-access-control-component/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,16 @@
6868
"@babel/runtime": "^7.6.3",
6969
"babel-loader": "^8.0.0",
7070
"cross-env": "^7.0.3",
71+
"css-loader": "^6.7.3",
7172
"dotenv-webpack": "^7.1.0",
7273
"eslint": "^8.8.0",
7374
"eslint-config-airbnb": "^19.0.4",
7475
"eslint-plugin-import": "^2.14.0",
7576
"eslint-plugin-jsx-a11y": "^6.1.0",
7677
"eslint-plugin-react": "^7.16.0",
78+
"file-loader": "^6.2.0",
79+
"less-loader": "^11.1.0",
80+
"mini-css-extract-plugin": "^2.7.2",
7781
"pre-commit": "^1.1.3",
7882
"react-hot-loader": "^1.3.0",
7983
"react-router-dom": "^5.1.2",

packages/tdb-access-control-component/webpack.config.js

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const path = require('path');
2+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
23

34
module.exports = (env, argv) => ({
4-
entry: './src/index.js',
5+
plugins: [new MiniCssExtractPlugin()],
6+
entry: './src/index.js',
57
module: {
68
rules: [
79
{
@@ -21,6 +23,53 @@ module.exports = (env, argv) => ({
2123
sourceMapFilename: 'terminusdb-access-control-component.min.js.map',
2224
library: 'TerminusDBAccessControl',
2325
},
26+
module: {
27+
rules: [
28+
{
29+
test: /\.js$/,
30+
exclude: /node_modules/,
31+
use: {
32+
loader:"babel-loader",
33+
options:{
34+
presets: [
35+
["@babel/preset-env"],
36+
"@babel/preset-react"
37+
],
38+
}
39+
},
40+
},
41+
{
42+
test: /\.(css|less)$/,
43+
use: [
44+
MiniCssExtractPlugin.loader,
45+
'css-loader', 'less-loader'
46+
],
47+
},
48+
{
49+
test: /\.(svg|jpg|gif|png)$/,
50+
use: [
51+
{
52+
loader: 'file-loader',
53+
options: {
54+
name: 'assets/images/[name].[ext]',
55+
}
56+
}
57+
]
58+
},
59+
{
60+
test: /\.(woff|woff2|eot|ttf|otf)$/,
61+
use: [
62+
{
63+
loader: 'file-loader',
64+
options: {
65+
outputPath: (url, resourcePath, context) => {
66+
return `assets/fonts/${path.basename(resourcePath)}`;
67+
}
68+
}
69+
}
70+
]
71+
}]
72+
},
2473
externals: {
2574

2675
react: {

0 commit comments

Comments
 (0)