Node.js - 生成丑陋的类名

时间:2017-03-19 18:01:57

标签: javascript html css node.js npm

有没有办法生成丑陋的类名?我的意思是,如果有一个插件,我可以使用我的CSS替换.top-header.a9ev。另外,如果我的html中的类名也被更改,那将会很棒

像facebook或Google这样的网站有多大这样做?

1 个答案:

答案 0 :(得分:0)

使用其中一种方法可能会有运气:

其中一些是通用工具,其中一些像public func selectInstrument(withDescription description: AudioComponentDescription, callback: @escaping SelectInstrumentCallback) { AVAudioUnit.instantiate(with: description, options: []) { avAudioUnit, error in guard let unit = avAudioUnit else { callback(nil) return } self.disconnectCurrent() self.connect(unit: unit) unit.auAudioUnit.requestViewController { viewController in callback(viewController) } } } private func disconnectCurrent() { guard let current = currentInstrument else { return } self.engine.disconnectNodeInput(engine.mainMixerNode) self.engine.detach(current) self.currentInstrument = nil self.engine.stop() } private func connect(unit: AVAudioUnit) { let hardwareFormat = self.engine.outputNode.outputFormat(forBus: 0) self.engine.connect(self.engine.mainMixerNode, to: self.engine.outputNode, format: hardwareFormat) self.engine.attach(unit) do { try ExceptionCatcher.catchException { let stereoFormat = AVAudioFormat(standardFormatWithSampleRate: hardwareFormat.sampleRate, channels: 2) self.engine.connect(unit, to: self.engine.mainMixerNode, format: stereoFormat) } } catch { let monoFormat = AVAudioFormat(standardFormatWithSampleRate: hardwareFormat.sampleRate, channels: 1) self.engine.connect(unit, to: self.engine.mainMixerNode, format: monoFormat) } unit.auAudioUnit.contextName = "Running in AU host demo app" self.currentInstrument = unit do { // Carbon Component Manager warning issued here: try self.engine.start() } catch { print("Failed to start engine") } } 这些非常具体的工具只做一件事 - 比如在这种情况下缩小CSS类名和ID。

确保在所有代码中使用相同版本的缩小名称,即通过相同(缩小或丑化)名称引用HTML,CSS和JavaScript中的类。