Coder Social home page Coder Social logo

san-webpack-loader's Introduction

san-webpack-loader

🌈 a webpack-v4 loader for San.js ☄️

Install

  npm install san-webpack-loader
  or
  yarn add san-webpack-loader

Usage

@file: webpack.config.js

// make sure the process.env.NODE_ENV is 'production' or 'development'
{
  test: /\.san$/,
  include: /src/,
  use: [
    {loader: 'babel-loader?cacheDirectory=true'},
    {
        loader: 'san-webpack-loader', options: {
            stylus: stylusOptions,
            hotReload: !isProduction,
            sourceMap: isProduction
        }
    }
  ]
}

TODO

  1. webpack4 Boilerplate 多线程优化
  2. css in js 方案

CHANGELOG

1.3.2

[内部变更]

  • 去除style-loader, 使用minicss的hot reload

1.2.7

[修复]

  • 移除html-loader支持,避免模板写 {{var < 2}}报错的问题

1.2.6

[新特性]

  • 模板支持导出san-store的方式如: export default connect.san

1.2.5

[修复]

  • 模板attrs大小写敏感,不会按照html标准进行转换,保留原样。1.2.3引入

1.2.4

[修复]

  • stylus options未设置,导致的报错

1.2.3

[新特性]

  • 增加sass支持

[内部变更]

  • isProduction改为config

1.2.2

[新特性]

  • san-webpack-loader的options对象支持stylus属性,可以对.san文件中的stylus部分进行配置

1.2.1

[新特性]

  • 增加less支持

1.2.0

[update]

  • 内部实现由同步loader改成异步,更好的利用多线程

1.1.3

[BUG修复]

  • 修复了windows环境下样式路径失效的问题,对os做了区分处理
  • 移除cache-loader,防止内联loader处理的样式文件被缓存后,无法被MiniCssExtractPlugin输出的问题

1.1.2

[BUG修复]

  • 随官方升级babelrc的设置,推荐在业务中使用babel.config.js

1.1.1

[新特性]

  • 升级babel依赖
  • 增加cache-loader options做文件缓存 需要安装cache-loader
  • 生产环境默认关闭sourcemap

License

MIT

san-webpack-loader's People

Contributors

jiangjiu avatar jinzhan avatar ksky521 avatar

Stargazers

Varsha avatar  avatar KAI avatar  avatar 1dao avatar MaXM avatar snail avatar YCS_Forever avatar  avatar  avatar

Watchers

James Cloos avatar  avatar

san-webpack-loader's Issues

配置打包后无法正常加载.san文件

webpack.config.js 里配置
{
test: /.san$/,
use: [
{loader: 'babel-loader?cacheDirectory=true'},
{loader: 'san-webpack-loader'}
]
}

路由组件中加载方式
Component: require('../documents/aaa.san')

aaa.san 文件内容
20_29_30__05_21_2019

报错Uncaught TypeError: t.Component is not a function,请问有使用这个 loader的项目架子吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.