index.js 459 B

12345678910111213141516171819
  1. // @ts-check
  2. module.exports = function (opts) {
  3. opts = opts || {}
  4. var method = opts.method || 'replace'
  5. return {
  6. postcssPlugin: 'postcss-replace-overflow-wrap',
  7. Declaration: {
  8. 'overflow-wrap': decl => {
  9. decl.cloneBefore({ prop: 'word-wrap' })
  10. if (method === 'replace') {
  11. decl.remove()
  12. }
  13. }
  14. }
  15. }
  16. }
  17. module.exports.postcss = true