kopia lustrzana https://github.com/shoelace-style/shoelace
formatting corrections
rodzic
f66535f7d4
commit
360cfa43d8
|
@ -41,15 +41,14 @@ function CustomEls({ URL }) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const { setBasePath } = require("@shoelace-style/shoelace/dist/utilities/base-path");
|
||||||
setBasePath
|
|
||||||
} = require("@shoelace-style/shoelace/dist/utilities/base-path");
|
|
||||||
|
|
||||||
setBasePath(`${URL}/static/static`);
|
setBasePath(`${URL}/static/static`);
|
||||||
|
|
||||||
// This imports all components
|
// This imports all components
|
||||||
require("@shoelace-style/shoelace/dist/shoelace");
|
require("@shoelace-style/shoelace/dist/shoelace");
|
||||||
// If you're wanting to selectively import components, replace this line with your own definitions
|
|
||||||
|
// If you want to selectively import components, replace this line with your own definitions
|
||||||
// require("@shoelace-style/shoelace/dist/components/button/button");
|
// require("@shoelace-style/shoelace/dist/components/button/button");
|
||||||
|
|
||||||
customEls.current = true;
|
customEls.current = true;
|
||||||
|
@ -95,7 +94,7 @@ MyApp.getInitialProps = async (context) => {
|
||||||
const URL = process.env.BASE_URL;
|
const URL = process.env.BASE_URL;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
URL,
|
URL
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
@ -112,24 +111,20 @@ const CopyPlugin = require("copy-webpack-plugin");
|
||||||
const withPlugins = require('next-compose-plugins');
|
const withPlugins = require('next-compose-plugins');
|
||||||
const withTM = require('next-transpile-modules')(['@shoelace-style/shoelace']);
|
const withTM = require('next-transpile-modules')(['@shoelace-style/shoelace']);
|
||||||
|
|
||||||
module.exports =
|
module.exports = withPlugins([withTM], {
|
||||||
withPlugins([withTM], {
|
webpack: config => {
|
||||||
webpack: (config) => {
|
|
||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
new CopyPlugin({
|
new CopyPlugin({
|
||||||
patterns: [
|
patterns: [
|
||||||
{
|
{
|
||||||
from: path.resolve(
|
from: path.resolve(__dirname, 'node_modules/@shoelace-style/shoelace/dist/assets/icons'),
|
||||||
__dirname,
|
to: path.resolve(__dirname, 'static/icons')
|
||||||
"node_modules/@shoelace-style/shoelace/dist/assets/icons"
|
}
|
||||||
),
|
]
|
||||||
to: path.resolve(__dirname, "static/icons"),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
return config;
|
return config;
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -137,6 +132,6 @@ module.exports =
|
||||||
|
|
||||||
## Additional Resources
|
## Additional Resources
|
||||||
|
|
||||||
- There is a third-party [example repo](https://github.com/crutchcorn/nextjs-shoelace-example), courtesy of [crutchcorn](https://github.com/crutchcorn) available to help you get started.
|
- There is a third-party [example repo](https://github.com/crutchcorn/nextjs-shoelace-example), courtesy of [crutchcorn](https://github.com/crutchcorn), available to help you get started.
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue