Skip to content

Commit

Permalink
Remove less support
Browse files Browse the repository at this point in the history
  • Loading branch information
shfshanyue committed Jul 31, 2019
1 parent 5be6889 commit e94a1a5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 708 deletions.
10 changes: 1 addition & 9 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
{
"presets": ["next/babel"],
"plugins": [
[
"import", {
"libraryName": "antd",
"style": true
}
]
]
"presets": ["next/babel"]
}
1 change: 0 additions & 1 deletion components/Footer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Link from 'next/link'
import { withRouter } from 'next/router'

const Footer = () => (
Expand Down
17 changes: 3 additions & 14 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
const withLess = require('@zeit/next-less')
const fs = require('fs')
const path = require('path')
// const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin

const theme = require('./theme.json')

// fix: prevents error when .less files are required by node
if (typeof require !== 'undefined') {
require.extensions['.less'] = (file) => {}
}

module.exports = withLess({
// TODO: 移除 less 支持
module.exports = {
lessLoaderOptions: {
javascriptEnabled: true,
},
webpack: (config, { isServer, ...rest }) => {
webpack: (config, { isServer }) => {
// if (!config.dev) {
// config.plugins.push(
// new SWPrecacheWebpackPlugin({
Expand Down Expand Up @@ -50,4 +39,4 @@ module.exports = withLess({

return config
}
})
}
Loading

0 comments on commit e94a1a5

Please sign in to comment.