diff --git a/examples/with-ant-design-less/.babelrc b/examples/with-ant-design-less/.babelrc deleted file mode 100644 index 04b7e1dae953e..0000000000000 --- a/examples/with-ant-design-less/.babelrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presets": ["next/babel"], - "plugins": [ - [ - "import", - { - "libraryName": "antd", - "style": true - } - ] - ] -} diff --git a/examples/with-ant-design-less/.gitignore b/examples/with-ant-design-less/.gitignore deleted file mode 100644 index 1437c53f70bc2..0000000000000 --- a/examples/with-ant-design-less/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# local env files -.env.local -.env.development.local -.env.test.local -.env.production.local - -# vercel -.vercel diff --git a/examples/with-ant-design-less/README.md b/examples/with-ant-design-less/README.md deleted file mode 100644 index 6241f2458afd0..0000000000000 --- a/examples/with-ant-design-less/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Ant Design example - -This example shows how to use Next.js along with [Ant Design of React](https://ant.design). This is intended to show the integration of this UI toolkit with the Framework. - -## Deploy your own - -Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example): - -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-ant-design-less&project-name=with-ant-design-less&repository-name=with-ant-design-less) - -## How to use - -Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: - -```bash -npx create-next-app --example with-ant-design-less with-ant-design-app -# or -yarn create next-app --example with-ant-design-less with-ant-design-app -``` - -Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). diff --git a/examples/with-ant-design-less/assets/antd-custom.less b/examples/with-ant-design-less/assets/antd-custom.less deleted file mode 100644 index 27ee020e93d1c..0000000000000 --- a/examples/with-ant-design-less/assets/antd-custom.less +++ /dev/null @@ -1,4 +0,0 @@ -@primary-color: #52c41a; - -@layout-header-height: 40px; -@border-radius-base: 2px; diff --git a/examples/with-ant-design-less/next.config.js b/examples/with-ant-design-less/next.config.js deleted file mode 100644 index 44b449b5b26b9..0000000000000 --- a/examples/with-ant-design-less/next.config.js +++ /dev/null @@ -1,40 +0,0 @@ -/* eslint-disable */ -const withLess = require('@zeit/next-less') -const lessToJS = require('less-vars-to-js') -const fs = require('fs') -const path = require('path') - -// Where your antd-custom.less file lives -const themeVariables = lessToJS( - fs.readFileSync(path.resolve(__dirname, './assets/antd-custom.less'), 'utf8') -) - -module.exports = withLess({ - lessLoaderOptions: { - javascriptEnabled: true, - modifyVars: themeVariables, // make your antd custom effective - }, - webpack: (config, { isServer }) => { - if (isServer) { - const antStyles = /antd\/.*?\/style.*?/ - const origExternals = [...config.externals] - config.externals = [ - (context, request, callback) => { - if (request.match(antStyles)) return callback() - if (typeof origExternals[0] === 'function') { - origExternals[0](context, request, callback) - } else { - callback() - } - }, - ...(typeof origExternals[0] === 'function' ? [] : origExternals), - ] - - config.module.rules.unshift({ - test: antStyles, - use: 'null-loader', - }) - } - return config - }, -}) diff --git a/examples/with-ant-design-less/package.json b/examples/with-ant-design-less/package.json deleted file mode 100644 index 268ca6c09392f..0000000000000 --- a/examples/with-ant-design-less/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "with-ant-design-less", - "version": "1.0.0", - "scripts": { - "dev": "next", - "build": "next build", - "start": "next start" - }, - "dependencies": { - "@zeit/next-less": "^1.0.1", - "antd": "^3.5.4", - "babel-plugin-import": "^1.7.0", - "less": "3.0.4", - "less-vars-to-js": "1.3.0", - "next": "latest", - "null-loader": "2.0.0", - "react": "^16.7.0", - "react-dom": "^16.7.0" - }, - "license": "MIT" -} diff --git a/examples/with-ant-design-less/pages/index.js b/examples/with-ant-design-less/pages/index.js deleted file mode 100644 index a73f721c0921d..0000000000000 --- a/examples/with-ant-design-less/pages/index.js +++ /dev/null @@ -1,88 +0,0 @@ -import { - Form, - Select, - InputNumber, - DatePicker, - Switch, - Slider, - Button, -} from 'antd' - -const FormItem = Form.Item -const Option = Select.Option - -export default function Home() { - return ( -
-
- - - Link - - - - - - - - - - - - - - - - - - - - - -
-
- ) -} diff --git a/examples/with-ant-design-pro-layout-less/.babelrc b/examples/with-ant-design-pro-layout-less/.babelrc deleted file mode 100644 index 04b7e1dae953e..0000000000000 --- a/examples/with-ant-design-pro-layout-less/.babelrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presets": ["next/babel"], - "plugins": [ - [ - "import", - { - "libraryName": "antd", - "style": true - } - ] - ] -} diff --git a/examples/with-ant-design-pro-layout-less/.gitignore b/examples/with-ant-design-pro-layout-less/.gitignore deleted file mode 100644 index 1437c53f70bc2..0000000000000 --- a/examples/with-ant-design-pro-layout-less/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# local env files -.env.local -.env.development.local -.env.test.local -.env.production.local - -# vercel -.vercel diff --git a/examples/with-ant-design-pro-layout-less/README.md b/examples/with-ant-design-pro-layout-less/README.md deleted file mode 100644 index ff6d5fd94eb2e..0000000000000 --- a/examples/with-ant-design-pro-layout-less/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Ant Design Pro Layout example - -This example shows how to use Next.js along with [Ant Design Pro Layout](https://github.com/ant-design/ant-design-pro-layout) of React. This is intended to show the integration of this UI toolkit with the Framework. - -## Deploy your own - -Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example): - -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-ant-design-pro-layout-less&project-name=with-ant-design-pro-layout-less&repository-name=with-ant-design-pro-layout-less) - -## How to use - -Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: - -```bash -npx create-next-app --example with-ant-design-pro-layout-less with-ant-design-app -# or -yarn create next-app --example with-ant-design-pro-layout-less with-ant-design-app -``` - -Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). diff --git a/examples/with-ant-design-pro-layout-less/assets/antd-custom.less b/examples/with-ant-design-pro-layout-less/assets/antd-custom.less deleted file mode 100644 index 27ee020e93d1c..0000000000000 --- a/examples/with-ant-design-pro-layout-less/assets/antd-custom.less +++ /dev/null @@ -1,4 +0,0 @@ -@primary-color: #52c41a; - -@layout-header-height: 40px; -@border-radius-base: 2px; diff --git a/examples/with-ant-design-pro-layout-less/layouts/main.tsx b/examples/with-ant-design-pro-layout-less/layouts/main.tsx deleted file mode 100644 index f184beb722607..0000000000000 --- a/examples/with-ant-design-pro-layout-less/layouts/main.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import dynamic from 'next/dynamic' -import Link from 'next/link' - -import { - SmileOutlined, - SettingOutlined, - PlaySquareOutlined, -} from '@ant-design/icons' - -import { Route, MenuDataItem } from '@ant-design/pro-layout/lib/typings' -import { SiderMenuProps } from '@ant-design/pro-layout/lib/SiderMenu/SiderMenu' - -const ProLayout = dynamic(() => import('@ant-design/pro-layout'), { - ssr: false, -}) - -const ROUTES: Route = { - path: '/', - routes: [ - { - path: '/', - name: 'Welcome', - icon: , - routes: [ - { - path: '/welcome', - name: 'Account Settings', - icon: , - }, - ], - }, - { - path: '/example', - name: 'Example Page', - icon: , - }, - ], -} - -const menuHeaderRender = ( - logoDom: React.ReactNode, - titleDom: React.ReactNode, - props: SiderMenuProps -) => ( - - - {logoDom} - {!props?.collapsed && titleDom} - - -) - -const menuItemRender = (options: MenuDataItem, element: React.ReactNode) => ( - - {element} - -) - -export default function Main({ children }) { - return ( - - {children} - - ) -} diff --git a/examples/with-ant-design-pro-layout-less/next-env.d.ts b/examples/with-ant-design-pro-layout-less/next-env.d.ts deleted file mode 100644 index 7b7aa2c7727d8..0000000000000 --- a/examples/with-ant-design-pro-layout-less/next-env.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/// -/// diff --git a/examples/with-ant-design-pro-layout-less/next.config.js b/examples/with-ant-design-pro-layout-less/next.config.js deleted file mode 100644 index 44b449b5b26b9..0000000000000 --- a/examples/with-ant-design-pro-layout-less/next.config.js +++ /dev/null @@ -1,40 +0,0 @@ -/* eslint-disable */ -const withLess = require('@zeit/next-less') -const lessToJS = require('less-vars-to-js') -const fs = require('fs') -const path = require('path') - -// Where your antd-custom.less file lives -const themeVariables = lessToJS( - fs.readFileSync(path.resolve(__dirname, './assets/antd-custom.less'), 'utf8') -) - -module.exports = withLess({ - lessLoaderOptions: { - javascriptEnabled: true, - modifyVars: themeVariables, // make your antd custom effective - }, - webpack: (config, { isServer }) => { - if (isServer) { - const antStyles = /antd\/.*?\/style.*?/ - const origExternals = [...config.externals] - config.externals = [ - (context, request, callback) => { - if (request.match(antStyles)) return callback() - if (typeof origExternals[0] === 'function') { - origExternals[0](context, request, callback) - } else { - callback() - } - }, - ...(typeof origExternals[0] === 'function' ? [] : origExternals), - ] - - config.module.rules.unshift({ - test: antStyles, - use: 'null-loader', - }) - } - return config - }, -}) diff --git a/examples/with-ant-design-pro-layout-less/package.json b/examples/with-ant-design-pro-layout-less/package.json deleted file mode 100644 index 95e949f66a972..0000000000000 --- a/examples/with-ant-design-pro-layout-less/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "with-ant-design-pro-layout-less", - "version": "1.0.0", - "scripts": { - "dev": "next", - "build": "next build", - "start": "next start" - }, - "dependencies": { - "@ant-design/icons": "4.1.0", - "@ant-design/pro-layout": "5.0.10", - "@zeit/next-less": "^1.0.1", - "antd": "^4.2.0", - "babel-plugin-import": "^1.13.0", - "esm": "3.2.25", - "less": "3.11.1", - "less-vars-to-js": "1.3.0", - "next": "latest", - "null-loader": "4.0.0", - "react": "^16.13.1", - "react-dom": "^16.13.1", - "webpack-filter-warnings-plugin": "1.2.1" - }, - "license": "MIT", - "devDependencies": { - "@types/node": "13.13.4", - "@types/react": "^16.9.36", - "typescript": "4.0" - } -} diff --git a/examples/with-ant-design-pro-layout-less/pages/example.tsx b/examples/with-ant-design-pro-layout-less/pages/example.tsx deleted file mode 100644 index a5b0b407f9d68..0000000000000 --- a/examples/with-ant-design-pro-layout-less/pages/example.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import MainLayout from '../layouts/main' - -export default function Example() { - return Example page -} diff --git a/examples/with-ant-design-pro-layout-less/pages/index.tsx b/examples/with-ant-design-pro-layout-less/pages/index.tsx deleted file mode 100644 index 840676f77d9b0..0000000000000 --- a/examples/with-ant-design-pro-layout-less/pages/index.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { - Form, - Select, - InputNumber, - DatePicker, - Switch, - Slider, - Button, -} from 'antd' - -import MainLayout from '../layouts/main' - -const FormItem = Form.Item -const Option = Select.Option - -export default function Home() { - return ( - -
- - - Link - - - - - - - - - - - - - - - - - - - - - -
-
- ) -} diff --git a/examples/with-ant-design-pro-layout-less/pages/welcome.tsx b/examples/with-ant-design-pro-layout-less/pages/welcome.tsx deleted file mode 100644 index b9cbb48699e08..0000000000000 --- a/examples/with-ant-design-pro-layout-less/pages/welcome.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import MainLayout from '../layouts/main' - -export default function Welcome() { - return Welcome! -} diff --git a/examples/with-ant-design-pro-layout-less/tsconfig.json b/examples/with-ant-design-pro-layout-less/tsconfig.json deleted file mode 100644 index c5d53d8983d19..0000000000000 --- a/examples/with-ant-design-pro-layout-less/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "strict": false, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve" - }, - "exclude": ["node_modules"], - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"] -} diff --git a/examples/with-next-less/.gitignore b/examples/with-next-less/.gitignore deleted file mode 100644 index 1437c53f70bc2..0000000000000 --- a/examples/with-next-less/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# local env files -.env.local -.env.development.local -.env.test.local -.env.production.local - -# vercel -.vercel diff --git a/examples/with-next-less/README.md b/examples/with-next-less/README.md deleted file mode 100644 index 40b19e1250cc7..0000000000000 --- a/examples/with-next-less/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Example App with next-less - -This example demonstrates how to use the [next-less plugin](https://github.com/zeit/next-plugins/tree/master/packages/next-less). - -It includes patterns for with and without CSS Modules, with PostCSS and with additional webpack configurations on top of the next-less plugin. - -## Deploy your own - -Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example): - -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-next-less&project-name=with-next-less&repository-name=with-next-less) - -## How to use - -Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: - -```bash -npx create-next-app --example with-next-less with-next-less-app -# or -yarn create next-app --example with-next-less with-next-less-app -``` - -Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). diff --git a/examples/with-next-less/next.config.js b/examples/with-next-less/next.config.js deleted file mode 100644 index 723f5c3891d60..0000000000000 --- a/examples/with-next-less/next.config.js +++ /dev/null @@ -1,17 +0,0 @@ -const withLess = require('@zeit/next-less') - -/* Without CSS Modules, with PostCSS */ -module.exports = withLess() - -/* With CSS Modules */ -// module.exports = withLess({ cssModules: true }) - -/* With additional configuration on top of CSS Modules */ -/* -module.exports = withLess({ - cssModules: true, - webpack: function (config) { - return config; - } -}); -*/ diff --git a/examples/with-next-less/package.json b/examples/with-next-less/package.json deleted file mode 100644 index 2a668a45eb5f9..0000000000000 --- a/examples/with-next-less/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "with-next-less", - "scripts": { - "dev": "next", - "build": "next build", - "start": "next start" - }, - "dependencies": { - "@zeit/next-less": "^1.0.1", - "less": "^3.0.4", - "next": "latest", - "react": "^16.7.0", - "react-dom": "^16.7.0" - }, - "license": "MIT" -} diff --git a/examples/with-next-less/pages/_document.js b/examples/with-next-less/pages/_document.js deleted file mode 100644 index af8e814a863dd..0000000000000 --- a/examples/with-next-less/pages/_document.js +++ /dev/null @@ -1,21 +0,0 @@ -/* -In production the stylesheet is compiled to .next/static/style.css and served from /_next/static/style.css - -You have to include it into the page using either next/head or a custom _document.js, as is being done in this file. -*/ - -import Document, { Html, Head, Main, NextScript } from 'next/document' - -export default class MyDocument extends Document { - render() { - return ( - - - -
- - - - ) - } -} diff --git a/examples/with-next-less/pages/index.js b/examples/with-next-less/pages/index.js deleted file mode 100644 index 2ba34bca22060..0000000000000 --- a/examples/with-next-less/pages/index.js +++ /dev/null @@ -1,13 +0,0 @@ -// Without CSS Modules -import '../style.less' -export default function Home() { - return
Hello Less!
-} - -// With CSS Modules -/* -import style from '../style.less' -export default function Home() { - return
Hello Less!
-} -*/ diff --git a/examples/with-next-less/style.less b/examples/with-next-less/style.less deleted file mode 100644 index 8e8957d30d386..0000000000000 --- a/examples/with-next-less/style.less +++ /dev/null @@ -1,5 +0,0 @@ -@theme: red; - -.example { - color: @theme; -}